insert blocks on many points

mboychuk

Usenet Archive
Joined
Feb 9, 2004
Messages
1
Reaction score
0
I have many points that have to have a block inserted on them. Does someone have a LISP that would do this for me. I Had one but when my computer crashed I lost it.

Thanks

Mike
 
mboychuk:
I have many points that have to have a block inserted on them. Does someone have a LISP that would do this for me. I Had one but when my computer crashed I lost it.

Thanks

Mike

(mapcar '(lambda (x) (command "insert" x "" "" "")) listofpoints)
 
Are your points 'POINT' entities? Or are they stored in a data file.

If the latter, ASCPOINT (http://www.caddzone.com/free.htm) will insert blocks (or a copy of anything you select) at every point it reads from a data file.

Copyright (c)2004 Tony Tanzillo
Unauthorized reproduction expressly prohibited.

mboychuk said:
I have many points that have to have a block inserted on them. Does someone have a LISP that would do this for me. I
Had one but when my computer crashed I lost it.
 
;ALIST defined as point list.

(setq cn 0)
(while (setq pt (nth cn alist))
;(vla-insertblock ADoc InsertionPoint, Name, Xscale, Yscale, Rotation) (setq cn (1+ cn))
)

mboychuk said:
I have many points that have to have a block inserted on them. Does
someone have a LISP that would do this for me. I Had one but when my computer crashed I lost it.
 
Rudy,

What is ADoc in (vla-insertblock ADoc InsertionPoint, Name, Xscale, Yscale, Rotation)

)
 
Jim,
that needs to be any block object
ie it can be: modelspace, paperspace or a named block definition object (where ever you wanted to insert the block 'Name') in other words the owner object of the new block reference insertion object to translate the vba help files to vla... the "Object" in the vba docs always becomes the first arg to the vla(x) function in lisp hth Mark
 
Mark,
I am really dense today. Can you give me an example of putting a block named TEST in modelspace at point PT? Thanks, Jim
 
(vl-load-com)
(setq myMS (vla-get-ModelSpace (vla-get-ActiveDocument
(vlax-get-Acad-Object))))
(setq pt '(12.0 12.0 0.0))
(setq myIns (vla-InsertBlock myMS (vlax-3d-point pt) "Test" 1.0 1.0 1.0
0.0))
 
Thank you very much.

R. Robert Bell said:
(vl-load-com)
(setq myMS (vla-get-ModelSpace (vla-get-ActiveDocument
(vlax-get-Acad-Object))))
(setq pt '(12.0 12.0 0.0))
(setq myIns (vla-InsertBlock myMS (vlax-3d-point pt) "Test" 1.0 1.0 1.0
0.0))
 

Latest threads

Back
Top