home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Share Gallery 1
/
share_gal_1.zip
/
share_gal_1
/
GR
/
GR506.ZIP
/
ACAD2.EXE
/
BRG.DOC
< prev
next >
Wrap
Text File
|
1989-01-28
|
3KB
|
72 lines
; *****************************************************************
;
; BRG.LSP
;
; Author: Paul Nance
; Home: (919)-226-3648
; Compuserve: [73627,1733]
;
; Function Description
; -------------------------------------------------------------
; C:BRG This routine annotates a selected boundry line
; from endpoint to endpoint, allows any combination
; of bearing and distance placements.
;
; Bearing and Distance Line Number prompt:
; A value of 1,2,3, etc.... above line placement
; A value of -1,-2,-3, etc.... below line placement
;
; Bearing and Distance % Line Length:
; A value of .25 1/4 of line length
; A value of .50 1/2 of line length
; A value of .75 3/4 of line length
;
(defun C:BRG ()
(GRAPHSCR)
(setvar "AUNITS" 4)
(setvar "CMDECHO" 0)
(setvar "OSMODE" 1)
(setq BLN (getreal "\nBearing Line Number: ")
DLN (getreal "\nDistance Line Number: ")
BLL (getreal "\nBearing % Line Length: ")
DLL (getreal "\nDistance % Line Number: ")
TH (getreal "\nText Height: ")
PT1 (getpoint "Enter First Point: ")
PT2 (getpoint "Enter Second Point: "))
(setq BP1 (polar PT1 (angle PT1 PT2)(*(distance PT1 PT2)BLL)))
(if(> BLN 0)
(setq VP4 (+(*(-(* BLN 1.5)0.5)TH)(* TH 0.25)))
(setq VP4 (-(*(+(* BLN 1.5)0.5)TH)(* TH 0.25))))
(setq PT4 (polar BP1 (+(angle PT1 PT2)(/ pi 2.0))VP4))
(setq DP1 (polar PT1 (angle PT1 PT2)(*(distance PT1 PT2)DLL)))
(if(> DLN 0)
(setq VP5 (+(*(-(* DLN 1.5)0.5)TH)(* TH 0.25)))
(setq VP5 (-(*(+(* DLN 1.5)0.5)TH)(* TH 0.25))))
(setq PT5 (polar DP1 (+(angle PT1 PT2)(/ pi 2.0))VP5))
(defun CONVERT (A2)
(setq NT "" TEST NIL)
(setq L (strlen A2))
(setq N 4)
(while (< = N L)
(setq DS (substr A2 N 1))
(if (= DS "d")
(progn
(setq DS "%%d")
(setq NT (strcat (substr A2 1 (1- N))
DS (substr A2 (1+ N))))
)
)
(if (= T TEST)(setq N (1+ L))(setq N (1+ N)))
)
(setq A2 NT)
)
(setq A1 (*(/(angle PT1 PT2)pi)180.0))
(setq A2 (angtos (angle PT1 PT2)4 4))
(setq D (strcat (rtos (distance PT1 PT2)2 2)"'"))
(if (>(strlen A2)6)(setq A2(CONVERT A2)))
(command "TEXT" "M" PT4 TH A1 A2)
(command "TEXT" "M" PT5 TH A1 D)
(setvar "OSMODE" 0)
(setq a "DONE")
)