jan_ek Posted August 17, 2011 Share Posted August 17, 2011 (edited) 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 August 17, 2011 by SLW210 Use CODE TAGS PLEASE!! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2011 Share Posted August 17, 2011 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) Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 17, 2011 Share Posted August 17, 2011 jan_ek, Please use CODE TAGS. I got you this time. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 17, 2011 Share Posted August 17, 2011 jan_ek, Please use CODE TAGS. I got you this time. If an award is given for using that emoticon the most, you've got everyone beat. LoL Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 17, 2011 Share Posted August 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
SLW210 Posted August 17, 2011 Share Posted August 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 17, 2011 Share Posted August 17, 2011 My pay is multiplied by the number of times I use that emoticon. Too bad anything times zero is still zero. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 17, 2011 Share Posted August 17, 2011 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 ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2011 Share Posted August 17, 2011 Another What about those users in Paperspace looking through a viewport to model... :wink: Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 17, 2011 Share Posted August 17, 2011 *cough*(getvar 'CVPORT)*cough* Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 17, 2011 Share Posted August 17, 2011 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 . Thanks Quote Link to comment Share on other sites More sharing options...
alanjt Posted August 17, 2011 Share Posted August 17, 2011 ............... Quote Link to comment Share on other sites More sharing options...
Tharwat Posted August 17, 2011 Share Posted August 17, 2011 What's the meaning of that look ? Too many mysterious phrases you're giving nowadays. Quote Link to comment Share on other sites More sharing options...
jan_ek Posted August 17, 2011 Author Share Posted August 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted August 17, 2011 Share Posted August 17, 2011 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. Quote Link to comment Share on other sites More sharing options...
jan_ek Posted August 18, 2011 Author Share Posted August 18, 2011 (edited) 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 August 18, 2011 by jan_ek Quote Link to comment Share on other sites More sharing options...
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.