Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Obtain Point Reference Number 1

Status
Not open for further replies.

nathangaldamez

New member
Jul 13, 2011
15
thread561-276765

When you use the feature Information->Object-> and you select a point you're able to see the reference name for the point, i.e. Point(1) or Point (2) depending on when it was created. Is there a way to retrieve this property in a Journal.
 
Replies continue below

Recommended for you

Here is a simple journal that demonstrates getting point feature names.

Option Strict Off
Imports System
Imports NXOpen

Module pointfeatname
Sub Main()

Dim s As Session = Session.GetSession()
Dim lw As ListingWindow = s.ListingWindow
Dim workPart As Part = s.Parts.Work
Dim pcol As PointCollection = workPart.Points
Dim fcol As Features.FeatureCollection = workPart.Features
Dim feat1 As Features.Feature
Dim featname1 As String = Nothing
If pcol.ToArray().Length = 0 Then
lw.Open()
lw.WriteLine("No Points found. Exit.")
Return
End If

For Each pt As Point In pcol
feat1 = fcol.GetAssociatedFeature(pt)
featname1 = feat1.GetFeatureName.ToString
If featname1.Substring(0, 5) = "Point" Then
MsgBox(featname1)
End If
Next

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

Regards

Frank Swinkels
 
That works perfectly! Thanks so much for your help.

-nathangaldamez
 
Frank,

How would translate this code to give me Ruled Surfaces instead of Points.

Thanks,

Nathan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor