Jump to content

Insert: using ActiveX


jan_ek

Recommended Posts

Hello.

As with the insert block ActiveX.Now I use the command.I would like to learn other methods of inserting blocks.This is a piece of code that I use

(command "._insert" (strcat name_block "="  patch name_block))(command)

I use this to change the definition of a block in the figure, the current block from a folder.

Edited by SLW210
Use CODE TAGS PLEASE!!
Link to comment
Share on other sites

To insert a block with ActiveX you would use the InsertBlock method, an example:

 

(setq activedoc (vla-get-activedocument (vlax-get-acad-object)))
(setq activespc
   (vlax-get-property activedoc
       (if
           (or
               (eq acmodelspace (vla-get-activespace activedoc))
               (eq :vlax-true (vla-get-mspace activedoc))
           )
           'modelspace
           'paperspace
       )
   )
)

(vla-insertblock activespc (vlax-3D-point '(0.0 0.0 0.0)) "YourBlockName" 1.0 1.0 1.0 0.0)

Link to comment
Share on other sites

The good/nice thing about using command to 'redefine' a block definition over vla-insertblock is you don't have to worry with creating an object in the drawing.

Link to comment
Share on other sites

If an award is given for using that emoticon the most, you've got everyone beat. LoL

 

My pay is multiplied by the number of times I use that emoticon. :rtfm:

Link to comment
Share on other sites

Another .

 

(setq acdoc (vla-get-activedocument (vlax-get-acad-object)))
(setq spc
      (if
        (eq 1 (vla-get-activespace acdoc))
         (vla-get-modelspace acdoc)
         (vla-get-paperspace acdoc)
      )
)

(vla-insertblock
 spc
 (vlax-3d-point '(0. 0. 0.))
 "Blockname"
 1.0
 1.0
 1.0
 0.0
)

Link to comment
Share on other sites

What about those users in Paperspace looking through a viewport to model... :wink:

 

Clever idea ,

 

If a viewport is opened , that would be a trap . :lol:

 

Thanks

Link to comment
Share on other sites

Insert the block works. Thanks.But I have a problem, if I already have inserted the drawing block.Then, even if you change the original file with a block, and so it puts me in a block that is already on the drawing.

Link to comment
Share on other sites

Insert the block works. Thanks.But I have a problem, if I already have inserted the drawing block.Then, even if you change the original file with a block, and so it puts me in a block that is already on the drawing.

 

If you specifically want to redefine the block using the InsertBlock Visual LISP method over the command expression, you should be able to redefine it by supplying the InsertBlock method with the full filename of the block, then deleting the resultant VLA-Object. This should update the block definition, although you may need to use ATTSYNC to update any attributes. A Regen will be required to reflect the modification of the definition across all references.

Link to comment
Share on other sites

So, yes.

1.Downloading a list of points appear

2.Clears blocks in Drawning

3.Purge blocks

4.Intercede blocks based on the collected letters

I have another problem. How do you do when the block is reflected in the mirror and how to get the rotation angle and scale

Edited by jan_ek
Link to comment
Share on other sites

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