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: 

Get Part/Assembly information from selected Drawing Curve

1 REPLY 1
Reply
Message 1 of 2
Anonymous
512 Views, 1 Reply

Get Part/Assembly information from selected Drawing Curve

Hi Everyone,

 

I'm currently working on a C#.NET Addin for Inventor 2011 that inserts a sketched symbol in a drawing, and automatically populates the symbol with relevant part information based on the drawing segment it is attached to. I've got the symbol insertion working just fine, and I'm pretty sure that the best way to get to the part information I need is to use the DrawingCurve.ModelGeometry property. Unfortunately, it returns a generic Object and I have no idea what to cast it into so that I can work with it. Can anyone give me a little information on how to handle this? Any alternative suggestions for getting the part information would be great too.

 

Thanks,

John

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

So I did a little trial and error, as well as a thorough scanning of the Programming Help for Inventor, and managed to define a fairly expansive set of objects that are accessible through the DrawingCurve.ModelGeometry property, and I thought I would share for others who might be interested. For the vast majority of selections on a Drawing View, the DrawingCurve's ModelGeometry will return an Edge (at least in my experiences testing). However, I also saw Face Objects returned as well. Based on some related call returns I found in the Programming Help, I also added the PartComponentDefinition, PartFeature and ComponentOccurrence objects to my list of handled return objects (To be honest I don't know if these are necessary). Well, my program works great now, cheers guys I hope someone finds this helpful (or interesting at least)!

 

Regards,

John

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

Post to forums  

Autodesk Design & Make Report