Jump to content

Inserting a block in a drawing for the first time through vla methods. Possible?


Recommended Posts

Posted

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.

Posted

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.
     )
)

 

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...