Originally Posted by
fletch97
Can someone take a look at the following Lisp routine and tell me where in the lisp its actually generating the arrowhead??
The lisp works great and will draw an arc'd leader but I want to copy the lisp and modify it to create another lisp that will do the same but insert or draw in a different symbol, rather than the arrowhead.
Any help would be greatly appreciated!
Hi fletch97
Play with this one (I'm not sure that there is what you need exactly,
I had take this from my old library and changed slightly)
After block insertion you need to align this block
and only after it you can specify end point of an arc
Tested on A2005 only
Thank you
f.
Code:
;; ARC LEADER WITH USER'S BLOCK ;;
(defun rtd (a)
(* 180.0 (/ a pi))
)
;; ;;
;; where 1,2,3 - there are block name, change by your needs
(defun C:AAB (/ *error* an ang blk cent mpt oad ocm osm pnt1 pnt2 pnt3
pta tmp tmp1 typ)
;error tile based on by J.Burke's rouitine
(defun *error* (msg)
(cond
((or (not msg)
(member msg
'("console break"
"Function cancelled"
"quit / exit abort"
)
)
)
)
((princ (strcat "\nError: " msg)))
)
(command "undo" "e")
(command "ucs" "p")
(setvar "cmdecho" ocm)
(setvar "osmode" osm)
(setvar "attdia" oad)
(princ)
)
(command "undo" "e")
(command "undo" "be")
(setq ocm (getvar "cmdecho"))
(setq osm (getvar "osmode"))
(setq oad (getvar "attdia"))
(setvar "attdia" 1)
(command "ucs" "w")
(setq typ (getstring T "\nEnter arrow type block 1/2/3 <1>\n"))
(if (eq typ "")
(setq typ "1")
)
(if typ
(progn
(setvar "osmode" 703)
(setq pnt1 (getpoint "\nStart Point: "))
(setvar "cmdecho" 0)
(command "-insert" typ '(0. 0. 0.) 1. 1. 0.)
(setq blk (entlast))
(command "move" blk "" '(0. 0. 0.) pnt1)
(command
"rotate"
"L"
""
pnt1
(rtd
(angle
pnt1
(setq pta (getpoint pnt1 "\nAlign block how you need : "))
)
)
)
(setq ang (angle pta pnt1))
(setq pnt2 (getpoint pnt1 "\nEnd Point: "))
(setq an (angle pnt1 pnt2))
(setvar "osmode" 0)
(setq mpt (mapcar '/ (mapcar '+ pnt1 pnt2) '(2 2 2)))
(setq tmp (polar mpt (+ an (/ pi 2)) 10.))
(setq tmp1 (polar pnt1 (+ ang (/ pi 2)) 10.))
(setq cent (inters pnt1 tmp1 mpt tmp nil))
(if
(> (angle cent pnt2) (angle cent pnt1))
(command "arc" "c" cent pnt1 pnt2)
(command "arc" "c" cent pnt2 pnt1)
)
(setq pnt1 nil
pnt2 nil
pnt3 nil
mpt nil
) ;for debug only
)
)
(*error* nil)
(princ)
)
;TesT:(repeat 16 (C:AAB))