Error Handling for suppressed named entities

Error Handling for suppressed named entities

william
Advocate Advocate
354 Views
1 Reply
Message 1 of 2

Error Handling for suppressed named entities

william
Advocate
Advocate

Hello All

I am using the assign name function in inventor to create a collection of faces that I can then export to dxf. 

This is working well, until I suppress the base feature for the solid which also suppresses the named face. 

When I have suppressed named faces the command 

iLogicVb.Automation.GetNamedEntities(doc).Entities

Will fault out. 

 

Any ideas how to handle this? 

I want to be able to suppress the faces so I can control what is being exported.
How do I get the unsuppressed named entities, and ignore the suppressed ones? 

File attached with rule inside. Try suppressing extrusion1 and running, vs unsuppressed extrusion 1. 

 

Dim oFace As Face
Dim oSB As SurfaceBody
Dim NamedEntities As NameValueMap
doc = ThisDoc.Document 


NamedEntities = iLogicVb.Automation.GetNamedEntities(doc).Entities
For j = 1 To NamedEntities.Count
	If NamedEntities.Name(j).Contains("EXPORT DXF") Then
		oFace = NamedEntities.Item(j)
		strSBName = oFace.SurfaceBody.Name
			If strSBName.Contains("REF_FOAM") Then
				MessageBox.Show(NamedEntities.Name(j), "Title")
			End If
	End If
Next

 

0 Likes
Accepted solutions (1)
355 Views
1 Reply
Reply (1)
Message 2 of 2

william
Advocate
Advocate
Accepted solution

Ok I have a workaround, but I think there is something wrong with the iLogicVb.Automation.GetNamedEntities(doc).Entities if the face is supressed. 

 

Dim oDoc As PartDocument
oDoc = ThisDoc.Document
Dim AttSets As AttributeSets
Dim AttSet As AttributeSet
Dim oSB As SurfaceBody
Dim oFace As Face

For Each oSB In oDoc.ComponentDefinition.SurfaceBodies
	If oSB.Name.Contains("REF_FOAM")
		For Each oFace In oSB.Faces
			If oFace.SurfaceType = SurfaceTypeEnum.kPlaneSurface Then
				If Not oFace Is Nothing Then
				    AttSets = oFace.AttributeSets
				    If AttSets.NameIsUsed("iLogicEntityNameSet") Then
				        AttSet = AttSets.Item("iLogicEntityNameSet")
				            For Each Att In AttSet
				             If Att.name = "iLogicEntityName" Then
				             	MsgBox ("Face name: " & Att.Value)
				             End If
				            Next
				    End If

				End If
			End If
		Next
	End If
Next

  

0 Likes