Jump to content

Recommended Posts

Posted

I have a lisp routine that draws an arc then an arrow at the end of the arc, similar to the leader command. What I want to do is make the arrowhead change according to the dimscale that I set the drawing to. We use a lot of details that we have pre-drafted with these arcs to save time, but I dont want to have to scale every arrowhead when i use them in a differently scaled drawing. Any suggestions? I am using Autocad 2007.

Posted
Would you be able to post the LISP to be modified?

 

Thanks

 

Here ya go.

 

(defun c:ARCARW ( / sblip shigh sorth ssnp saptr arc1 arc1s arc2 arc3 rotpt pt rot th dim) ;IMB1ARW

(setvar "cmdecho" 0)

(command "undo" "g")

(setq as (getvar "dimscale"))

(prompt "\nArc (3 pt) Arrow: ")

(setq arc1 (getpoint "\nEnter first arc point: "))

(setq arc2 (getpoint "\nEnter second arc point: "))

(command "color" "green")

(command "linetype" "S" "hidden" "" "")

(command "arc" arc1 arc2 pause)

(setq arc3 (getvar "lastpoint") en (entlast) ed (entget en))

(command "color" "bylayer")

(command "linetype" "S" "continuous" "" "")

(setq rotpt (polar arc3 (angle arc3 arc2) (* 0.1 (getvar "dimscale"))))

(setq rad (cdr (assoc 40 ed)) cen (cdr (assoc 10 ed)))

(setq arrw (* 0.0625 (getvar "dimscale")) bside (sqrt (- (* rad rad) (* arrw arrw))))

(setq radend (angle cen arc3) difang (atan (/ arrw bside)))

(arcdir ed arc3) ;RETURNS ARCD EITHER "E" OR "N"

(if (= arcd "E") ;EQUAL, ADD 90 to ANGLES

(progn (setq newang (+ radend difang) rotang (+ newang pi))

)

(progn (setq newang (- radend difang) rotang (- newang pi))

)

)

(setq mopt (polar cen newang rad) rot (angle arc3 mopt) rotd (* (/ rot pi) 180))

(command "-INSERT" "L:/LIBRARY/i66" arc3 as as (* (/ rot pi) 180))

(command "undo" "e") (prin1)

(setvar "cmdecho" 1)

)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...