In a part document can an entity be named via iLogic. I have accessed an edge like so:
oDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition oCompDef.SurfaceBodies.Item(1).Edges.Item(1)
it would make sense for me to then add on:
.Name("myFirstEdge")
However this isn't an option. Is this something I can do?
Solved! Go to Solution.
In a part document can an entity be named via iLogic. I have accessed an edge like so:
oDoc = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition oCompDef.SurfaceBodies.Item(1).Edges.Item(1)
it would make sense for me to then add on:
.Name("myFirstEdge")
However this isn't an option. Is this something I can do?
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
Hi @harvey_craig2RCUH. Try this:
Dim Doc As Inventor.Document = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oEdge As Edge = oCompDef.SurfaceBodies.Item(1).Edges.Item(1)
Dim oNEs As NamedEntities = iLogicVb.Automation.GetNamedEntities(Doc)
oNEs.SetName(oEdge, "Edge Name")
You can also access this special iLogic only resource through the following:
ThisDoc.NamedEntities
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield
(Not an Autodesk Employee)
Hi @harvey_craig2RCUH. Try this:
Dim Doc As Inventor.Document = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oDoc.ComponentDefinition
Dim oEdge As Edge = oCompDef.SurfaceBodies.Item(1).Edges.Item(1)
Dim oNEs As NamedEntities = iLogicVb.Automation.GetNamedEntities(Doc)
oNEs.SetName(oEdge, "Edge Name")
You can also access this special iLogic only resource through the following:
ThisDoc.NamedEntities
If this solved your problem, or answered your question, please click ACCEPT SOLUTION .
Or, if this helped you, please click (LIKE or KUDOS) 👍.
Wesley Crihfield
(Not an Autodesk Employee)
Cheers Wesley, problem solved!
Cheers Wesley, problem solved!
Just be aware that the iLogic term 'ThisDoc' may be accessing a different document than the phrase 'ThisApplication.ActiveDocument ' in some situations. That is why there is two different ways to access that NamedEntities object. We can also do the same task using Inventor API code, instead of iLogic API code, but it requires more code. When you assign a name to a Face, Edge, or Vertex using the manual 'Assign Name' tool (in parts only - right-click menu, when one is selected), or by using the iLogic NamedEntities methods, this is essentially just creating an AttributeSet on that object (within its AttributeSets collection), then creating an Attribute within that AttributeSet, with a String ValueType value, and the supplied name as the Value of that Attribute. We can also find these objects using the AttributesManager object that we can get from the owning Document object (Document.AttributeManager).
Wesley Crihfield
(Not an Autodesk Employee)
Just be aware that the iLogic term 'ThisDoc' may be accessing a different document than the phrase 'ThisApplication.ActiveDocument ' in some situations. That is why there is two different ways to access that NamedEntities object. We can also do the same task using Inventor API code, instead of iLogic API code, but it requires more code. When you assign a name to a Face, Edge, or Vertex using the manual 'Assign Name' tool (in parts only - right-click menu, when one is selected), or by using the iLogic NamedEntities methods, this is essentially just creating an AttributeSet on that object (within its AttributeSets collection), then creating an Attribute within that AttributeSet, with a String ValueType value, and the supplied name as the Value of that Attribute. We can also find these objects using the AttributesManager object that we can get from the owning Document object (Document.AttributeManager).
Wesley Crihfield
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.