Cadastrophic
31st Oct 2004, 11:32 pm
I've been having a ball this weekend since discovering that handy routine to attach lisps to buttons.
I have a query with one of the lisps I found: Basically, the lisp places sequential numeric callouts inside circles on the end of straight leaders. perfect for what I want. The only problem is, when it places the number inside the circle, it appears rotated 90 degrees anticlockwise. I can see in the lisp that it refers to "polar p2" which presumably is the culprit, but I'm not brave enough to play with the code. Can any of you geniuses help with the number rotation.
Can anyone point to something I can change to correct the direction of rotation?
In AutoCAD, I have my base angle set to North and Direction is set to Clockwise.
Here's the code as I've loaded it:
(defun c:B1 ()
(setvar "cmdecho" 0)
(setvar "attdia" 0)
(setvar "texteval" 1)
(setq os (getvar "osmode"))
(setvar "orthomode" 0)
(setq pt1 (getpoint "Pick starting point:"))
(command "line" pt1 pause "")
(setq pt2 (getvar "lastpoint"))
(setq rang (angle pt1 pt2))
(setq ang (/ rang 0.017453))
(setq dsc (getvar "dimtxt"))
(setq pt3 (polar pt2 rang (* dsc 1.2903)))
(if (<= inc 100)
(progn
(setvar "osmode" 1024)
(command "circle" pt3 (* dsc 1.2903))
(command "text" "m" pt3 dsc "0" (itoa inc))
(command "donut" "0.001" (* 0.25 dsc) pt1 "")
(setq inc (+ inc 1))
)
)
(setvar "osmode" os)
(setvar "orthomode" 1)
)
I have a query with one of the lisps I found: Basically, the lisp places sequential numeric callouts inside circles on the end of straight leaders. perfect for what I want. The only problem is, when it places the number inside the circle, it appears rotated 90 degrees anticlockwise. I can see in the lisp that it refers to "polar p2" which presumably is the culprit, but I'm not brave enough to play with the code. Can any of you geniuses help with the number rotation.
Can anyone point to something I can change to correct the direction of rotation?
In AutoCAD, I have my base angle set to North and Direction is set to Clockwise.
Here's the code as I've loaded it:
(defun c:B1 ()
(setvar "cmdecho" 0)
(setvar "attdia" 0)
(setvar "texteval" 1)
(setq os (getvar "osmode"))
(setvar "orthomode" 0)
(setq pt1 (getpoint "Pick starting point:"))
(command "line" pt1 pause "")
(setq pt2 (getvar "lastpoint"))
(setq rang (angle pt1 pt2))
(setq ang (/ rang 0.017453))
(setq dsc (getvar "dimtxt"))
(setq pt3 (polar pt2 rang (* dsc 1.2903)))
(if (<= inc 100)
(progn
(setvar "osmode" 1024)
(command "circle" pt3 (* dsc 1.2903))
(command "text" "m" pt3 dsc "0" (itoa inc))
(command "donut" "0.001" (* 0.25 dsc) pt1 "")
(setq inc (+ inc 1))
)
)
(setvar "osmode" os)
(setvar "orthomode" 1)
)