Message 1 of 2
iLogic - Get NamedEntity of Part from Assembly level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm trying to make a rule, running from an assembly, that checks if the selected face is a named entity and if so, return the name of that face. So far I've got it to work on the part itself, looking like this:
Sub SelectFace() Dim oDoc As PartDocument Set oDoc = ThisApplication.ActiveDocument Dim CompDef As ComponentDefinition Set CompDef = oDoc.ComponentDefinition Dim AttSets As AttributeSets Dim AttSet As AttributeSet Dim oFace As Face Set oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllPlanarEntities, "Select the face") If Not oFace Is Nothing Then Set AttSets = oFace.AttributeSets If AttSets.NameIsUsed("iLogicEntityNameSet") Then Set AttSet = AttSets.Item("iLogicEntityNameSet") For Each Att In AttSet If Att.name = "iLogicEntityName" Then 'Get the name of the Face MsgBox ("Face name: " & Att.Value) End If Next Else MsgBox ("No valid face selected") End If End If End Sub
Happy for any advice!