harrison-matt Posted March 3, 2011 Posted March 3, 2011 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 Quote
alanjt Posted March 3, 2011 Posted March 3, 2011 http://www.cadtutor.net/forum/showthread.php?57239-Add-ssget-to-select-specific-Blocks Quote
Lee Mac Posted March 3, 2011 Posted March 3, 2011 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. 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.