Jump to content

Recommended Posts

Posted

can someone translate this into macro? thanks:)

 

 

(setq l_ang 60)

(setq l_ang1 120)

(defun c:q (/ sty nm p1 p2 ateblk p3)

(command "cmdecho" "0")

(setq osm (getvar "osmode"))

(setq ort (getvar "orthomode"))

;(command "osmode" "2")

(setq p1 (getpoint "\nPick origin point:)"))

(command "osmode" "0")

(command "orthomode" "0")

(setq p2 (getpoint "\nPick target" p1))

(princ)

(if (

(progn

(if (

(setq p3d (- (cadr p1) (cadr p2)))

)

(if (

(setq p3d (- (cadr p2) (cadr p1)))

)

(if (

(progn

(setq p3 (polar p2 (+ 0.0 (dtr (- l_ang))) (* p3d 1.1547)))

(command "LEADER" p2 p3 p1 "" "" "n")

)

)

(if (

(progn

(setq p3 (polar p2 (+ 0.0 (dtr l_ang)) (* p3d 1.1547)))

(command "LEADER" p2 p3 p1 "" "" "n")

)

)

)

)

(if (

(progn

(if (

(setq p3d (- (cadr p1) (cadr p2)))

)

(if (

(setq p3d (- (cadr p2) (cadr p1)))

)

(if (

(progn

(setq p3 (polar p2 (+ 0.0 (dtr (- l_ang1))) (* p3d 1.1547)))

(command "LEADER" p2 p3 p1 "" "" "n")

)

)

(if (

(progn

(setq p3 (polar p2 (+ 0.0 (dtr l_ang1)) (* p3d 1.1547)))

(command "leader" p2 p3 p1 "" "" "n")

)

)

)

)

(command "osmode" osm)

(command "orthomode" ort)

)

;

(defun dtr (a)

(* pi (/ a 180.0))

)

;

Posted

please help, i want macro for leader that has an automatic angle (60,120,240,300)...

 

i have one but it's not perfect, i have to make xline to get exact angle...

 

^C^C_xline;hor \^C^C_qleader _non \pick point \\^C^C_erase \;^c^cATTEDIT

leader.jpg

Posted

Use Mleader, easy to set this up using that instead of qleader.

 

Or set Polar to 60 and go that route.

Posted

For what purpose do you want it in a macro? If it is so you can run it in LT, then it won't work - because LT doesn't support lisp (at least not without some plug-in). And quite a lot of what's there cannot be done in normal Macro/Diesel code.

 

If you mean you want to call that from a macro in something above ACad LT, then you have 2 options:

 

  • Save it to a LSP file, then make a macro like:

^C^C(load "C:/Path/Filename")Q

  • Or copy all of it to a macro and prefix with ^C^C^P, remove new-lines, remove all the comments starting with ;, and suffix with Q:

^C^C^P(setq l_ang 60)(setq .... "orthomode" ort))(defun dtr (a) (* pi (/ a 180.0)))Q

Posted

Thanks Irneb, i was using full version before, but our company downgraded to AutoCAD LT

2011, since we cant run lisp in lt i want it to be written in macro or diesel, but if it cannot be, please help me to develop this code

 

 

^C^C_qleader;\

 

The problem with this is i can't make it in right angle (60,120,300,240)

 

Or please help me to do same as above lisp routine using qleader.

 

Thank you.

Posted

thanks but mleader cannot be matchprop:(

Posted

Thanks, since we cannot run it in LT, is it possible to make it using qleader with same setting?

 

please help me develop this code..

 

^C^C_xline;hor \^C^C_qleader _non \pick point \\^C^C_erase \;^c^cATTEDIT

leader.jpg

Posted

Did you mention match prop in your first post? Did you try setting polar on?

Posted
thanks but mleader cannot be matchprop:(

Yes it can. Why wouldn't it be able to?

Posted

I have combined and moved your threads. Please post the same question only once.

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...