Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm working within the assembly level. I'm looking to grab a FaceProxy, find the source of the FaceProxy, and name the source surface.
The code below, appears to work just fine. But the changes aren't being pushed through to the part document.
It appears to grab the correct surface. But the name does not appear within the entities list within the .ipt and when closing and re-opening the assembly it can no longer find the named entity.
Sub Main Dim x As Integer = 0 Dim oADoc As AssemblyDocument = ThisDoc.Document Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition Dim oConsts As AssemblyConstraints = oADef.Constraints For Each oConst As AssemblyConstraint In oConsts Dim oEnt1 As Object = oConst.EntityOne Dim oEnt2 As Object = oConst.EntityTwo x = x + 1 Dim oSourceFace1 As Face = Nothing Dim oFace1 As Face = Nothing Dim oSourceFace2 As Face = Nothing Dim oFace2 As Face = Nothing oSource1 = oEnt1 oSourceFace1 = oSource1.GetSourceFace If oSourceFace1 Is Nothing Then oFace1 = oSource1.NativeObject Else oFace1 = oSourceFace1 End If oSource2 = oEnt2 oSourceFace2 = oSource2.GetSourceFace If oSourceFace2 Is Nothing Then oFace2 = oSource2.NativeObject Else oFace2 = oSourceFace2 End If oName = "Entity1:" & x Call AssignNameToEntity(oFace1, oName) Dim EntityOne As String = GetEntityName(oFace1) MsgBox(EntityOne) oName = "Entity2:" & x Call AssignNameToEntity(oFace2, oName) Dim EntityTwo As String = GetEntityName(oFace2) MsgBox(EntityTwo) Next End Sub
Solved! Go to Solution.