Hi,
I'm creating a template part to line the inside of a wall with wall boards. All the boards are drawn as an array of seperate solid bodies which are to be made into components once the windows and appertures have been extruded out.
The problem is when the wall changes to a shorter length and then back again. the solids are re-created and the extrusion e.g. Window1 does not have the new solids in it's effected solids list, so I get an error.
Is there a way to set the extrusions "effected solids" (Not sure if that's the correct term) to all the solids all the time through iLogic or the API?
Thanks in advance.
GavoGarmo
It would actually be ideal if I could make all extrusions in the part effect all the solid bodies, all of the time.
Unfortunately I don't think you can do that if the solids do not exist at the time you create the extrusion...
You could set up some event handlers (maybe ModelingEvents - just a guess) so that when a solid is created, you can call "PartFeature.SetAffectedBodies" and pass all the bodies you want to be affected. But you would definitely need to call that method every time a new solid shows up.
I hope it helps,
Philippe.
Hi Phillippe,
My knowledge of the API is still lacking. I'd found some refernces to "SetAffectedBodies" in the programming help file.
We intend to use the same 6 extrusions in the template part and simply suppress them when the number required is less than six.
We have some other code that changes the visibility of solid bodies. It uses a line of code that finds solids that startswith "solid".
Could method be used that applies the 6 extrusions to all solid bodies that name starts with "Solid" ?
Thanks for your help
There is no direct way to select all the solids you are interested in based on their name, moreover that name can be changed by the user. You would need to iterate through the SurfaceBodies collection and check each name with custom code.
Other ways to identify objects from the API imply to attach metadata to the solid bodies in advance, so you can retrieve them later on: take a look at how Attributes and Reference Keys are working in the API Help Files.
Regards,
Philippe.
Thanks Philippe
I'll post if I find an alternative solution that others may find useful.
Take Care