Extracting Constraints and Joints Information from Autodesk Inventor Using C# Add-In

Extracting Constraints and Joints Information from Autodesk Inventor Using C# Add-In

pedro_vieira63ULQ
Observer Observer
372 Views
1 Reply
Message 1 of 2

Extracting Constraints and Joints Information from Autodesk Inventor Using C# Add-In

pedro_vieira63ULQ
Observer
Observer

Hi everyone,

 

Has anyone here tried to retrieve information about constraints and joints from an Autodesk Inventor file?

I’m currently developing a C# tool to do this, using the Inventor Add-in API. I’m still new to this area, but I’ve already managed to extract some basic information successfully. I’ll share a portion of my code below that allows me to access certain data.

However, I’ve encountered a few issues:

  • I’m not entirely sure which specific information is required to fully describe a constraint or joint so it can be recreated outside of Inventor.
  • I haven’t found a way to get a unique ID or reference for the exact entity (for example, a specific face) used in a constraint.
  • I haven´t found too a way to reach the information about the entityOne (example in print).

For example:
If I have a cube with six faces, all faces seem to share the same ID, which makes it impossible to know which face was used in a particular constraint when trying to recreate it externally.

If anyone has experience with this or can point me to relevant documentation, examples, or best practices, I would really appreciate it!

Thanks in advance for any help or guidance you can provide.

Note: I will leave an dialog box that shows the information that i get running my C# script in a simple Inventor CAD. 

0 Likes
373 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

Hi @pedro_vieira63ULQ.  I am not fluent in C#, but am good with vb.net, which is similar.  I have dabbled in that area before, and have a code example I can share, which I had stored in my custom iLogic snippets from some similar scenario before.  I will attach it as a text file, to keep it simple & clean.  It is about 98 percent Inventor API, but does contain a few terms that are unique to iLogic API, such as the following, which may need to be replaced:

ThisDoc.Document property

Logger.Debug method  & Logger.Info method

iLogicVb.RuleName property

Since there are so many 'sub-types' (derived types) of constraints, and each has its own properties & methods which may be unique to that type, it can be pretty challenging.  This does not cover assembly 'Joints' though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)