Cancel
Showing results for 
Search instead for 
Did you mean: 

Re: How to get start point of each patterned instance

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

@danijelVR,

Can you post the relevant code snippet that sets up and uses the .GetArcLengthBetweenPoints method?

Re: How to get start point of each patterned instance

Valued Contributor
Valued Contributor

Hello @cowski1,

I am not sure that I undersand well but as I said in some previous reply, code that I built to get arc length between start point of the curve and many other points on the curve, collected in point collection called "trcrvPoints" is showed bellow.

 

        Dim compositeCurve12 As NXOpen.Features.CompositeCurve = CType(workPart.Features.FindObject("EXTRACTED_CURVE(1)"), NXOpen.Features.CompositeCurve)
        Dim spline12 As NXOpen.Spline = CType(compositeCurve12.FindObject("CURVE 1"), NXOpen.Spline)
        Dim theCurves(0) As NXOpen.Curve
        theCurves(0) = spline12
        Dim zero As Scalar = workPart.Scalars.CreateScalar(0, Scalar.DimensionalityType.None, SmartObject.UpdateOption.WithinModeling)
        Dim curveStartPoint As NXOpen.Point = workPart.Points.CreatePoint(theCurves(0), zero, SmartObject.UpdateOption.WithinModeling)

        Dim length As Double = Nothing

        For i = 0 To trcrvPoints.Count - 1
            ' // To get arc length between start point on curve And each other point to the end point
            theSession.Measurement.GetArcLengthBetweenPoints(curveStartPoint, trcrvPoints(i), length, theCurves)
            lw.WriteLine("0 - " & i & " = " & length)
        Next