petewirth
Mechanical
- Dec 8, 2010
- 6
Is there anyone who has experience of NX OPEN in NX7.5?
I'm trying to construct a script that will identify geometry such as faces and edges according to attributes (colour etc). The following works in 'Modelling' but I have come unstuck when trying the equivalent in 'Advanced Simulation'
Dim edge_1 As NXOpen.Edge
Dim point_1 As NXOpen.Point
Dim b As NXOpen.Part = workPart
For Each c As NXOpen.Body In b.Bodies
For Each d As NXOpen.Face In c.GetFaces
Dim e As Integer = d.Color
If e = 20 Then
For Each f As NXOpen.Edge In d.GetEdges
edge_1 = f
Next
point_1 = workPart.Points.CreatePoint(edge_1, SmartObject.UpdateOption.WithinModeling)
point_1.SetVisibility(SmartObject.VisibilityOption.Visible)
MsgBox(point_1.Coordinates.X)
MsgBox(point_1.Coordinates.Y)
MsgBox(point_1.Coordinates.Z)
End If
Next
Next
Any help much appreciated!
I'm trying to construct a script that will identify geometry such as faces and edges according to attributes (colour etc). The following works in 'Modelling' but I have come unstuck when trying the equivalent in 'Advanced Simulation'
Dim edge_1 As NXOpen.Edge
Dim point_1 As NXOpen.Point
Dim b As NXOpen.Part = workPart
For Each c As NXOpen.Body In b.Bodies
For Each d As NXOpen.Face In c.GetFaces
Dim e As Integer = d.Color
If e = 20 Then
For Each f As NXOpen.Edge In d.GetEdges
edge_1 = f
Next
point_1 = workPart.Points.CreatePoint(edge_1, SmartObject.UpdateOption.WithinModeling)
point_1.SetVisibility(SmartObject.VisibilityOption.Visible)
MsgBox(point_1.Coordinates.X)
MsgBox(point_1.Coordinates.Y)
MsgBox(point_1.Coordinates.Z)
End If
Next
Next
Any help much appreciated!