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.
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
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()
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
Regards
Frank Swinkels
RE: NX Journal: Determine Total Length of Composite Curve
Where can I find more information?
Thanks,
Jeff
RE: NX Journal: Determine Total Length of Composite Curve
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