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: 
Reply
Message 1 of 2
MarkBrouwersIntent
762 Views, 1 Reply

Entity naming

Hi,

When I open a memberfile,  and go to the Entity Naming Editor, I can see the names for the faces used in the part. How can I retrieve this information via API ? In a previous release this was saved in an attributeset, called Intent. Did they changed this with the new release ? I want to be able to retrieve the name of a selected face.

 

Cheers,

Mark

1 REPLY 1
Message 2 of 2

Hi Mark,

 

We keep the names for Faces/Edges/Vertices in the attributesets "Intent", attribute "Name".

The code below allows to enumerate all such entities on the Part document:

    Dim doc As PartDocument
    Set doc = ThisApplication.ActiveDocument
    
    Dim attsen As AttributesEnumerator
    Set attsen = doc.AttributeManager.FindAttributes("Intent", "Name")
    
    Dim att As Inventor.Attribute
    Dim objectTypeStr As String
    For Each att In attsen
        Select Case att.Parent.Parent.Parent.Type
        Case kFaceObject
            objectTypeStr = "Face named "
        Case kEdgeObject
            objectTypeStr = "Edge named "
        Case kVertexObject
            objectTypeStr = "Vertex named "
        Case Else
            objectTypeStr = "Something " + CStr(att.Parent.Parent.Parent.Type) + " named "
        End Select
        
        Debug.Print objectTypeStr + att.Value
    Next

The output is similar to:

Face named Face1
Face named Face2
Face named Face3

 

Please note that names are stored on objects, not on the proxies to them.

 

If you select a face on the part included into assembly, you will get the proxy to the Face object. You will need to use .NativeObject call to get from FaceProxy to the Face.

 

The additional code sample is here.

Thank you,




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

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

Post to forums  

Autodesk Design & Make Report