Jump to content

Recommended Posts

Posted

All,

 

I have hit a wall with several hopeful programs this is what I need to learn:

 

I need to learn how to access the objects within a block, the expode method states: "You do not have to explode a block in order to manipulate its constituent entities. All block definitions have an Item method that allow you to manipulate the entities within the block without exploding the block definition itself." Well i cannot find this method.

 

I need to know how to run a program on several open drawings, I suspected that i could be able to accomplish this by grabbing the documents in autocad then aquiring a count and stepping through each one with item and setting it active but the program just stopped.

 

how can i SUBST a layer in an entity, i.e. change the layer of an entity.

 

Any suggestions would be greatly appreciated.

 

Kind Regards,

Matt

Posted

After reading the above thread which demonstrates the coding side of things, perhaps think about blocks in the following way:

 

Just as you have a Layer collection containing all the layers in the drawing, and a Block Collection containing all the blocks in the drawing, each Block Definition within the Block Collection is a Collection in itself - containing all the objects that make up that block definition.

 

In this way, the ModelSpace and (multiple) PaperSpace objects are also Block Definitions containing all the objects in ModelSpace and PaperSpace respectively. Hence, when you have acquired the Block Definition object (perhaps using vla-item on the Blocks Collection), you can iterate through the objects contained therein using vlax-for, just as you would with any other VLA Collection Object.

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