- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i try to Split a 3D Curve.
I took a similar Scrip for Split2D Curve, which works for 2D curves, but my Goal is to Split a 3D Curve.
I use the SDKInventorAddIn in Visual Studio
Public Sub SampleCommandFunction()
Dim partDoc As PartDocument
partDoc = g_inventorApplication.ActiveDocument
Dim spline As Object
spline = g_inventorApplication.CommandManager.Pick(SelectionFilterEnum.kSketch3DCurveFilter, "Select 3d spline")
' Get the spline geometry from the entity.
Dim splineCurve As BSplineCurve
splineCurve = spline.Geometry
' Determine the parameter value for geometric midpoint of the curve.
Dim curveEval As CurveEvaluator
curveEval = splineCurve.Evaluator
Dim startParam As Double
Dim endParam As Double
Call curveEval.GetParamExtents(startParam, endParam)
Dim midParam As Double
Call curveEval.GetParamAtLength(startParam, spline.Length / 2, midParam)
' Split the curve.
Dim curve1 As BSplineCurve
Dim curve2 As BSplineCurve
Call splineCurve.Split(midParam, curve1, curve2)
' Create new sketch curves using the extracted splines.
Dim splineSketch As Sketch3D
splineSketch = spline.Parent
Call splineSketch.SketchFixedSplines.Add(curve1)
Call splineSketch.SketchFixedSplines.Add(curve2)
' Delete the original curve.
spline.Delete
End Sub
I can select a Curve, but without any Result.
Actually my Goal is to Split the Curve with equal Length and also choose the quantity, but first only in Middle
Any Suggestion.
Thanks
Solved! Go to Solution.