Help giving and using entity names in another document
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey all,
I am making some code that needs named edges for the sake of placing constraints. However, I can't go into each part and name things. I know that the constraints tool is able to name edges and then immediately use them without any conflicting names. I am trying to do basically exactly what the constraints tool does. But i don't know how to go about it.
My best attempt as of yet involves finding the part document and then using
oEdge = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartEdgeCircularFilter, "Please select your bolt edge")
Dim oEdgeBody As SurfaceBody = oEdge.Parent
Dim oEdgePart As ComponentOccurrence = oEdgeBody.Parent
Dim oEdgeDoc As Document = oEdgePart.Definition.Document
Dim oNamedEntities = iLogicAuto.GetNamedEntities(oEdgeDoc)
Try
oNamedEntities.SetName(oEdge, "")
But i honestly don't knw what to do at this point, I named it "" because i was told this would make inventor pick the name itself, but once the name is made i don't know what it will be, and therefor don't know how to access it. I could make the assumption that it will be the highest number edge, or the last item in the list, but I don't know how inventor handles the names or if it sorts them.