@MechMachineMan, thanks for pointing this out. I know they had been talking about providing this capability as part of iLogic but I didn't know it had gone into the product.
Regarding the original question, I took a look at this and the iLogic naming is using API attributes to implement it. Remember that iLogic is an add-in and is using the same API functionality that everyone else is to provide its functionality. Here's some code that will return a Face or Edge object that has the specified name.
Public Sub GetNameTest()
Dim doc As PartDocument = ThisApplication.ActiveDocument
Dim faceOrEdge As Object = GetNamedEntity(doc, "Brian")
End Sub
Public Function GetNamedEntity(doc As Inventor.Document, name As String) As Object
Dim attribMgr As AttributeManager = doc.AttributeManager
Dim objsFound As ObjectCollection
objsFound = attribMgr.FindObjects("iLogicEntityNameSet", "iLogicEntityName", name)
If objsFound.Count > 0 Then
Return(objsFound.Item(1))
Else
Return(Nothing)
End If
End Function
The AttributeManager utility provides a good view of what's going on.
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com