MJLM Posted May 31, 2019 Posted May 31, 2019 Hello, I m looking for a way to import a drawing as block into an other drawing through activeX (vla, vl etc) methods. Is it possible? I am not talking about (re)inserting an already inserted block in the drawing. My intent is to insert it from a specific path on disk for the first time. Is it possible? An example, a snippet will be appreciated. Quote
Tharwat Posted May 31, 2019 Posted May 31, 2019 Hi, Yes its possible. (and (setq fnd (findfile DwgPath)) (not (tblsearch "BLOCK" (vl-filename-base fnd))) (vla-insertblock (vlax-get (vla-get-activelayout (vla-get-activedocument (vlax-get-acad-object)) ) 'Block ) (vlax-3d-point '(0.0 0.0 0.0)) fnd 1.0 1.0 1.0 0. ) ) Quote
rlx Posted May 31, 2019 Posted May 31, 2019 (edited) to make it easy for me : http://www.lee-mac.com/copyblockdefinition.html http://www.lee-mac.com/steal.html oh darn , Tharwat was just a sec earlier Edited May 31, 2019 by rlx 1 Quote
BIGAL Posted June 1, 2019 Posted June 1, 2019 A bit more the standard insert command has the option to browse and insert a complete drawing. plain lisp (command "-insert" blockname pt x y ang atts atts atts) block name can be any dwg you have access to. Quote
MJLM Posted June 1, 2019 Author Posted June 1, 2019 Thank you all for your replies. I am familiar with the (command "insert"... technique. However, I though the vla method would be faster but to my surprise it is not. The vla method comes actually third when tested inside a loop of inserting 1000 times the block, after 'entmakex' and 'insert' options. 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.