jmyrwen Posted May 25, 2011 Posted May 25, 2011 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)) ) ; Quote
jmyrwen Posted May 27, 2011 Author Posted May 27, 2011 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 Quote
rkent Posted May 27, 2011 Posted May 27, 2011 Use Mleader, easy to set this up using that instead of qleader. Or set Polar to 60 and go that route. Quote
irneb Posted May 27, 2011 Posted May 27, 2011 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 Quote
jmyrwen Posted May 28, 2011 Author Posted May 28, 2011 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. Quote
jmyrwen Posted May 29, 2011 Author Posted May 29, 2011 thanks but mleader cannot be matchprop:( Quote
jmyrwen Posted May 29, 2011 Author Posted May 29, 2011 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 Quote
rkent Posted May 29, 2011 Posted May 29, 2011 Did you mention match prop in your first post? Did you try setting polar on? Quote
tzframpton Posted May 29, 2011 Posted May 29, 2011 thanks but mleader cannot be matchprop:( Yes it can. Why wouldn't it be able to? Quote
SLW210 Posted May 31, 2011 Posted May 31, 2011 I have combined and moved your threads. Please post the same question only once. Quote
Recommended Posts
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.