×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NX Journal: Determine Total Length of Composite Curve

NX Journal: Determine Total Length of Composite Curve

NX Journal: Determine Total Length of Composite Curve

(OP)
I'm trying to extract the arclength of a composite curve created by the WAVE linker.  I want to capture a variable as if I were to select ANALYSIS->MEASURE LENGTH and select the composite curve.  I tried the code below, but the measureDistanceBuilder wants a "displayable object" and all I have is a composite curve.

CODE

Dim measureDistanceBuilder1 As MeasureDistanceBuilder
            Dim added1 As Boolean
            Dim nullUnit As Unit = Nothing
            Dim objects1(0) As DisplayableObject
            Dim curvetag as NXOpen.tag
            Dim measureLength1 As MeasureLength
        
            measureDistanceBuilder1 = workPart.MeasureManager.CreateMeasureDistanceBuilder(nullNXObject)
            measureDistanceBuilder1.Mtype = MeasureDistanceBuilder.MeasureType.Minimum
            measureDistanceBuilder1.InfoWindow = False
            objects1(0) = NXObjectManager.Get(ExtractedEdge.tag)
            added1 = measureDistanceBuilder1.LengthObjects.Add(objects1)
            measureLength1 = workPart.MeasureManager.NewLength(nullUnit, objects1)
            measureLength1.Information()
            measureLength1.Dispose()

Secondly, I've finally found the list of VB (.NET) functions for NX Journal as a CHM file, but it is very terse.  Where can I find more information (besides this forum) to help myself become more self-sufficient?

Thanks,
Jeff

RE: NX Journal: Determine Total Length of Composite Curve

Your Linked Composite Curves are features and you need to get the curve of the feature to measure it.  If you use Analysis->Measure Length interactively you will see that it works with the actual curve.

Regards

Frank Swinkels

RE: NX Journal: Determine Total Length of Composite Curve

(OP)
So I need to dissect my composite curve into separate curve entities.  I see there is a GetEntities() method but I don't understand how to use it.

Where can I find more information?

Thanks,
Jeff

RE: NX Journal: Determine Total Length of Composite Curve

Below is a simple journal that displays the curves of selected composite curve features.

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.Features

Module Module1

  Sub Main()

   Dim theSession As Session = Session.GetSession()
   Dim theUI As UI = UI.GetUI()
   Dim selectedFeatures As Feature()
   Dim compositestring As String = "Select composite curves"
   Dim curves() As NXObject

   selectedFeatures = selectFeatures(compositestring)

   For Each compositecurve1 As Features.CompositeCurve In selectedFeatures
     curves = compositecurve1.GetEntities
       For i As Integer = 0 To curves.Length - 1
         MsgBox(curves(i).ToString)
       Next
     Next

  End Sub
  Function selectFeatures(ByVal prompt As String) As Features.Feature()
  Dim theUI As UI = UI.GetUI
    selectFeatures = Nothing
    theUI.SelectionManager.SelectFeatures(prompt, Selection.SelectionFeatureType.Browsable, selectFeatures)
  End Function

  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

Hope this helps

Frank Swinkels

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources