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
Solved! Go to Solution.
Solved by AlexKorzun. Go to Solution.
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.