jmarkus
Mechanical
- Jul 11, 2001
- 377
Hi, me again...
I'm trying to create a section curve feature given an edge and a join curve feature (from the edge). My code tries to get the body (EdgeParent) belonging to the selected edge (selEdge) and convert the join curve feature (JoinedCurve) into a spline, in order to make cuts along and normal to the spline.
Unfortunately this returns a "Null Tag not allowed" error, which suggests one of the lines isn't doing what it is supposed to do and when the feature tries to commit, it fails.
But of course, I can't figure out which line is the culprit. Any suggestions, as always, would be appreciated.
Thanks,
Jeff
I'm trying to create a section curve feature given an edge and a join curve feature (from the edge). My code tries to get the body (EdgeParent) belonging to the selected edge (selEdge) and convert the join curve feature (JoinedCurve) into a spline, in order to make cuts along and normal to the spline.
Code:
Dim joinCurves1 As NXOpen.Features.JoinCurves = JoinedCurve
EdgeParent=selEdge.OwningComponent
Dim spline1 As NXOpen.Spline = CType(joinCurves1.getEntities(0), NXOpen.Spline)
Dim body1 As NXOpen.Body = CType(EdgeParent, NXOpen.Body)
'********************* Create Sections through Body ***********************
Dim sectionCurveBuilder1 As NXOpen.Features.SectionCurveBuilder = Nothing
sectionCurveBuilder1 = workPart.Features.CreateSectionCurveBuilder(nullNXOpen_Features_Feature)
sectionCurveBuilder1.CurveFitData.Tolerance = 0.01
sectionCurveBuilder1.CurveFitData.AngleTolerance = 0.5
sectionCurveBuilder1.ChordalTolerance = 0.01
sectionCurveBuilder1.Type = NXOpen.Features.SectionCurveBuilder.PlaneType.PerpendicularToCurve
sectionCurveBuilder1.StartDistance = -500.0
sectionCurveBuilder1.EndDistance = 500.0
sectionCurveBuilder1.StepDistance = 50.0
sectionCurveBuilder1.SpacingAlongCurveType = NXOpen.Features.SectionCurveBuilder.SpacingType.IncrementalArclengthSpacing
sectionCurveBuilder1.Increment = 100.0
sectionCurveBuilder1.Associative = False
sectionCurveBuilder1.GroupObjects = True
Dim added1 As Boolean = Nothing
added1 = sectionCurveBuilder1.ObjectsToSection.Add(body1)
sectionCurveBuilder1.CurveForPerpendicularPlane.Value = spline1
sectionCurveBuilder1.Associative = True
Dim SectionCuts As NXOpen.NXObject = Nothing
SectionCuts = sectionCurveBuilder1.Commit()
Unfortunately this returns a "Null Tag not allowed" error, which suggests one of the lines isn't doing what it is supposed to do and when the feature tries to commit, it fails.
But of course, I can't figure out which line is the culprit. Any suggestions, as always, would be appreciated.
Thanks,
Jeff