Merve Posted April 6, 2017 Share Posted April 6, 2017 Hi everyone I'm using LeeMac's Align objects to Curve lisp. But i need to do it multiple like a chain. It may be like array option of copy command. -enter number of items to align -distance between objects etc Thank you all especially Lee Mac Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 6, 2017 Share Posted April 6, 2017 Do it once then shorten the pline etc and do again a 2 link chain. Quote Link to comment Share on other sites More sharing options...
Merve Posted April 7, 2017 Author Share Posted April 7, 2017 Do it once then shorten the pline etc and do again a 2 link chain. I want to do it once Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 7, 2017 Share Posted April 7, 2017 And you can't use the MEASURE or DIVIDE command with the Block and "Align block with object" options because.............? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 8, 2017 Share Posted April 8, 2017 If you look at this lisp it draws a block repeatedly along a pline, using a spacing increment. It also uses two points to rotate correctly. The same theory could be applied to a chain link with a UP & Down link iteration. To test just make a block with a horizontal line 3.05 long with insertion point on right end. (Defun draw_vehicle ( ) (SETQ ANGBASEE (GETVAR "ANGBASE")) (SETQ ANGDIRR (GETVAR "ANGDIR")) (SETQ LUNITSS (GETVAR "LUNITS")) (SETQ LUPRECC (GETVAR "LUPREC")) (SETQ AUNITSS (GETVAR "AUNITS")) (SETQ AUPRECC (GETVAR "AUPREC")) (setq oldsnap (getvar "osmode")) (SETVAR "LUNITS" 2) (SETVAR "ANGBASE" 0.0) (SETVAR "ANGDIR" 0) (SETVAR "LUPREC" 0) (SETVAR "AUNITS" 3) (SETVAR "AUPREC" 0) (setvar "osmode" 0) ;(if (tblsearch "Block" "Holden") ;(princ "Holden") ;(progn ;(command "Insert" "p:\\Autodesk\\vba\\holdencar.dwg" "0,0" 1 1 0) ;(command "erase" "last" "") ; progn (setq obj (vlax-ename->vla-object (car (entsel "\nPick Pline")))) (setq interval ( getreal "\nEnter spacing m:")) (setq cRad 3.05) (setq startang (* pi 1.5)) (setq endang (/ pi 2.0)) (setq dist 0.0) (setq len (vla-get-length obj)) (setq stpt (vlax-curve-getpointatdist obj interval)) (setq num (+ 1 (fix ( / len interval)))) (repeat num (command "arc" "C" stpt (polar stpt endang crad)(polar stpt startang crad)) (setq objarc (vlax-ename->vla-object (entlast))) (if (= (setq intpt (vlax-invoke obj 'intersectWith objarc acExtendnone)) nil) (setq intpt (vlax-invoke obj 'intersectWith objarc acExtendThisEntity)) ; needed at start ) (vla-delete objarc) (setq ang (angle intpt stpt)) (command "Insert" "Holden" stpt 1 1 ang) ; need ang in radians (setq stpt (vlax-curve-getpointatdist obj (setq dist (+ dist interval)))) ) ; repeat (SETVAR "LUNITS" lunitss) (SETVAR "ANGBASE" angbasee) (SETVAR "ANGDIR" angdirr) (SETVAR "LUPREC" luprecc) (SETVAR "AUNITS" aunitss) (SETVAR "AUPREC" auprecc) (princ) ) ; defun (draw_vehicle) Quote Link to comment Share on other sites More sharing options...
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.