|
您可以遍歷集合來處理每個特徵或查找特定的特徵。
Option Strict Off
Imports System
Imports NXOpen
Module Module1
Sub Main()
Dim theSession As Session = Session.GetSession()
If IsNothing(theSession.Parts.Work) Then
'active part required
Return
End If
Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow
lw.Open()
For Each myFeature As Features.Feature In workPart.Features
If TypeOf (myFeature) Is Features.PointSet Then
lw.WriteLine(".GetFeatureName: " & myFeature.GetFeatureName)
lw.WriteLine(".Name: " & myFeature.Name)
lw.WriteLine(".FeatureType: " & myFeature.FeatureType)
lw.WriteLine(".Timestamp: " & myFeature.Timestamp.ToString)
lw.WriteLine("")
Dim myPoints() As NXObject = myFeature.GetEntities
For Each tempPt As Point In myPoints
lw.WriteLine(tempPt.Coordinates.ToString)
Next
End If
Next
lw.Close()
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
|
评分
-
查看全部评分
|