Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Apply extrusion to all solid bodies all of the time API

5 REPLIES 5
Reply
Message 1 of 6
GavoGarmo
483 Views, 5 Replies

Apply extrusion to all solid bodies all of the time API

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

5 REPLIES 5
Message 2 of 6
GavoGarmo
in reply to: GavoGarmo

It would actually be ideal if I could make all extrusions in the part effect all the solid bodies, all of the time.

Message 3 of 6

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 4 of 6

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

Message 5 of 6

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.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

Message 6 of 6

Thanks Philippe

 

I'll post if I find an alternative solution that others may find useful.

 

Take Care

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report