Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Retrieving the automation name (entity naming editor)

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
676 Views, 2 Replies

Retrieving the automation name (entity naming editor)

Hi,
When I select an entity in Inventor I would like to retrieve his 'automation'name (the one I assigned in Intent via the entity naming editor) using the API of Inventor/Intent.
I succeded in retrieving the automation part of a inventor part using the RefChainFromHostObject('selected nventorpart'). But then I'm stuck.
How can I retrieve his automation name?

Cheers,
Mark
2 REPLIES 2
Message 2 of 3
AlexKorzun
in reply to: Anonymous

Hi Mark,

The names are stored in Inventor attributes.The code below extracts the Intent name assigned to a Face:


Inventor.Face face = ...;

Inventor.FaceProxy faceP = face as Inventor.FaceProxy;
if( faceP != null)
face = faceP.NativeObject;

string entityName = null;
Inventor.AttributeSets attss = face.AttributeSets;
Inventor.AttributeSet atts = null;
if (attss.get_NameIsUsed("Intent"))
{
atts = attss["Intent"];
if( atts.get_NameIsUsed("Name"))
{
Inventor.Attribute att = atts["Name"];
if( att.ValueType == Inventor.ValueTypeEnum.kStringType)
entityName = att.Value as string;
}
}

The similar code will work for Vertices and Edges.

--Alex Korzun
Autodesk Intent Development
Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks Alex, works like a charme.

Cheers,
Mark

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

Post to forums  

Autodesk Design & Make Report