rroell Posted May 22, 2009 Posted May 22, 2009 I want to insert a block called "Valveblock22" on a layer called "Valve22" I have approximately 4,000 points that this block needs to be added to. Is there a way I can do this easily? A lisp progaram or something? Any help will be much appreciated. Quote
dbroada Posted May 22, 2009 Posted May 22, 2009 I can't actually help although there are plenty around who can but it is relatively easy using LISP or VBA provided your points are available in a sensible format. What format do you have them in? Quote
BIGAL Posted May 25, 2009 Posted May 25, 2009 Do you have the points as a xyz text file ? You could just do a script use search replace and create as below I have previously mentioned using ^p with MS word. script would be insert myblock x,y,z 1 1 0 ie insert myblock 12,25,0 1 1 0 insert myblock 42,34,0 1 1 0 etc It should only take a couple of minutes here is an example using word to change 47,993.846, 5015.394, 0 46,987.285, 5022.663, 0 45,937.182, 5040.847, 0 44,949.015, 5040.7, 0 43,961.301, 5038.069, 0 42,972.357, 5033.287, 0 41,978.957, 5029.282, 0 load into word do the following find replace ^p with ^pinsert myblock find replace ^p with 1 1 0^p You will need to edit first line then save as a script please note its hard here to show but watch out for extra spaces they react as if you pressed the enter key see spaces between x & y need to be removed search for ", " replace "," insert myblock 993.846,5015.394,0 1 1 0 insert myblock 987.285,5022.663,0 1 1 0 insert myblock 937.182,5040.847,0 1 1 0 insert myblock 949.015,5040.7,0 1 1 0 note also removed the point number you can vertically delete in word put mouse to top left hold alt key and window via mouse then delete Quote
Commandobill Posted May 26, 2009 Posted May 26, 2009 If you legitimately have points on your drawing and need blocks there then you could go with something simple like this. (defun c:bins ( / ) (setq drac 0 ss (ssget "X" (list (cons 0 "POINT"))) ) (setvar "cmdecho" 0) (while (< drac (sslength ss)) (setq pnt (cdr (assoc 10 (entget (ssname ss drac))))) (command "-insert" "Valveblock22" pnt 1 1 0) (setq drac (1+ drac)) ) (setvar "cmdecho" 1) ) Quote
rroell Posted May 26, 2009 Author Posted May 26, 2009 I was able to generate a x,y,z point list and followed the steps and it worked fine. Although I needed to take off the last "1" in the sequence. (must be the way I have my insert button set up.) Thanks for the help! Quote
pule Posted September 8, 2010 Posted September 8, 2010 If you legitimately have points on your drawing and need blocks there then you could go with something simple like this. (defun c:bins ( / ) (setq drac 0 ss (ssget "X" (list (cons 0 "POINT"))) ) (setvar "cmdecho" 0) (while (< drac (sslength ss)) (setq pnt (cdr (assoc 10 (entget (ssname ss drac))))) (command "-insert" "Valveblock22" pnt 1 1 0) (setq drac (1+ drac)) ) (setvar "cmdecho" 1) ) Hey i have try your LISP for my blocks ( in Civil 3d 2011) and block have showd on one point not on multiple points Quote
pule Posted September 14, 2010 Posted September 14, 2010 Is there any possibility that i can choose block which i wish to insert? Quote
YahooSAM Posted December 19, 2021 Posted December 19, 2021 Tried the "Bins" lisp contained in this string.... worked like a dream on 2,973 autocad points - thanks!!!!!!! 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.