' NX 9.0.3.4 ' Journal created by jd on Thu Feb 26 09:48:31 2015 Mitteleuropäische Zeit ' Option Strict Off Imports System Imports NXOpen Module NXJournal Sub Main (ByVal args() As String) Dim theSession As Session = Session.GetSession() Dim workPart As Part = theSession.Parts.Work Dim displayPart As Part = theSession.Parts.Display ' ---------------------------------------------- ' Menü: Einfügen->Konstruktionsformelement->Zylinder... ' ---------------------------------------------- Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim nullFeatures_Feature As Features.Feature = Nothing If Not workPart.Preferences.Modeling.GetHistoryMode Then Throw(New Exception("Create or edit of a Feature was recorded in History Mode but playback is in History-Free Mode.")) End If Dim cylinderBuilder1 As Features.CylinderBuilder cylinderBuilder1 = workPart.Features.CreateCylinderBuilder(nullFeatures_Feature) cylinderBuilder1.BooleanOption.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies1(0) As Body Dim nullBody As Body = Nothing targetBodies1(0) = nullBody cylinderBuilder1.BooleanOption.SetTargetBodies(targetBodies1) cylinderBuilder1.Diameter.RightHandSide = "84.5" cylinderBuilder1.Height.RightHandSide = "65" cylinderBuilder1.BooleanOption.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies2(0) As Body targetBodies2(0) = nullBody cylinderBuilder1.BooleanOption.SetTargetBodies(targetBodies2) theSession.SetUndoMarkName(markId1, "Zylinder-Dialogfenster") Dim unit1 As Unit unit1 = cylinderBuilder1.Height.Units Dim expression1 As Expression expression1 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) cylinderBuilder1.Destroy() workPart.Expressions.Delete(expression1) theSession.UndoToMark(markId1, Nothing) theSession.DeleteUndoMark(markId1, Nothing) ' ---------------------------------------------- ' Menü: Einfügen->Sketch... ' ---------------------------------------------- Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim nullSketch As Sketch = Nothing Dim sketchInPlaceBuilder1 As SketchInPlaceBuilder sketchInPlaceBuilder1 = workPart.Sketches.CreateNewSketchInPlaceBuilder(nullSketch) Dim expression2 As Expression expression2 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression3 As Expression expression3 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim sketchAlongPathBuilder1 As SketchAlongPathBuilder sketchAlongPathBuilder1 = workPart.Sketches.CreateSketchAlongPathBuilder(nullSketch) sketchAlongPathBuilder1.PlaneLocation.Expression.RightHandSide = "0" theSession.SetUndoMarkName(markId2, "Skizze erzeugen-Dialogfenster") Dim datumPlane1 As DatumPlane = CType(workPart.Datums.FindObject("DATUM_CSYS(2) YZ plane"), DatumPlane) Dim point1 As Point3d = New Point3d(14.0036896106573, 17.9438627093241, 1.11022302462516e-016) sketchInPlaceBuilder1.PlaneOrFace.SetValue(datumPlane1, workPart.ModelingViews.WorkView, point1) Dim datumCsys1 As Features.DatumCsys = CType(workPart.Features.FindObject("DATUM_CSYS(2)"), Features.DatumCsys) Dim point2 As Point = CType(datumCsys1.FindObject("POINT 1"), Point) sketchInPlaceBuilder1.SketchOrigin = point2 sketchInPlaceBuilder1.PlaneOrFace.Value = Nothing sketchInPlaceBuilder1.PlaneOrFace.Value = datumPlane1 Dim datumAxis1 As DatumAxis = CType(workPart.Datums.FindObject("DATUM_CSYS(2) X axis"), DatumAxis) sketchInPlaceBuilder1.Axis.Value = datumAxis1 Dim markId3 As Session.UndoMarkId markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.DeleteUndoMark(markId3, Nothing) Dim markId4 As Session.UndoMarkId markId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.Preferences.Sketch.CreateInferredConstraints = True theSession.Preferences.Sketch.ContinuousAutoDimensioning = True theSession.Preferences.Sketch.DimensionLabel = Preferences.SketchPreferences.DimensionLabelType.Expression theSession.Preferences.Sketch.TextSizeFixed = True theSession.Preferences.Sketch.FixedTextSize = 3.0 theSession.Preferences.Sketch.ConstraintSymbolSize = 3.0 theSession.Preferences.Sketch.DisplayObjectColor = False theSession.Preferences.Sketch.DisplayObjectName = True Dim nXObject1 As NXObject nXObject1 = sketchInPlaceBuilder1.Commit() Dim sketch1 As Sketch = CType(nXObject1, Sketch) Dim feature1 As Features.Feature feature1 = sketch1.Feature Dim markId5 As Session.UndoMarkId markId5 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "update") Dim nErrs1 As Integer nErrs1 = theSession.UpdateManager.DoUpdate(markId5) sketch1.Activate(Sketch.ViewReorient.True) theSession.DeleteUndoMark(markId4, Nothing) theSession.SetUndoMarkName(markId2, "Skizze erzeugen") sketchInPlaceBuilder1.Destroy() sketchAlongPathBuilder1.Destroy() Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression3) Catch ex As NXException ex.AssertErrorCode(1050029) End Try Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression2) Catch ex As NXException ex.AssertErrorCode(1050029) End Try ' ---------------------------------------------- ' Menü: Einfügen->Kurve skizzieren->Kreis... ' ---------------------------------------------- Dim markId6 As Session.UndoMarkId markId6 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") Dim markId7 As Session.UndoMarkId markId7 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") Dim expression4 As Expression expression4 = workPart.Expressions.CreateSystemExpression("84") theSession.SetUndoMarkVisibility(markId7, "Curve", Session.MarkVisibility.Visible) Dim nXMatrix1 As NXMatrix nXMatrix1 = theSession.ActiveSketch.Orientation Dim center1 As Point3d = New Point3d(0.0, 0.0, 0.0) Dim arc1 As Arc arc1 = workPart.Curves.CreateArc(center1, nXMatrix1, 42.0, 0.0, ( 360.0 * Math.Pi/180.0 )) theSession.ActiveSketch.AddGeometry(arc1, Sketch.InferConstraintsOption.InferNoConstraints) Dim geom1_1 As Sketch.ConstraintGeometry geom1_1.Geometry = arc1 geom1_1.PointType = Sketch.ConstraintPointType.ArcCenter geom1_1.SplineDefiningPointIndex = 0 Dim geom2_1 As Sketch.ConstraintGeometry geom2_1.Geometry = point2 geom2_1.PointType = Sketch.ConstraintPointType.None geom2_1.SplineDefiningPointIndex = 0 Dim sketchGeometricConstraint1 As SketchGeometricConstraint sketchGeometricConstraint1 = theSession.ActiveSketch.CreateCoincidentConstraint(geom1_1, geom2_1) Dim dimObject1_1 As Sketch.DimensionGeometry dimObject1_1.Geometry = arc1 dimObject1_1.AssocType = Sketch.AssocType.Midpoint dimObject1_1.AssocValue = 0 dimObject1_1.HelpPoint.X = 0.0 dimObject1_1.HelpPoint.Y = 0.0 dimObject1_1.HelpPoint.Z = 0.0 Dim nullNXObject As NXObject = Nothing dimObject1_1.View = nullNXObject Dim dimOrigin1 As Point3d = New Point3d(0.0, 3.02764837615143, 0.0) Dim sketchDimensionalConstraint1 As SketchDimensionalConstraint sketchDimensionalConstraint1 = theSession.ActiveSketch.CreateDiameterDimension(dimObject1_1, dimOrigin1, expression4, Sketch.DimensionOption.CreateAsDriving) Dim dimension1 As Annotations.Dimension dimension1 = sketchDimensionalConstraint1.AssociatedDimension theSession.ActiveSketch.Update() Dim markId8 As Session.UndoMarkId markId8 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menü: Einfügen->Konstruktionsformelement->Extrudieren... ' ---------------------------------------------- theSession.DeleteUndoMark(markId8, "Curve") Dim markId9 As Session.UndoMarkId markId9 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim extrudeBuilder1 As Features.ExtrudeBuilder extrudeBuilder1 = workPart.Features.CreateExtrudeBuilder(nullFeatures_Feature) Dim section1 As Section section1 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5) extrudeBuilder1.Section = section1 extrudeBuilder1.AllowSelfIntersectingSection(True) Dim unit2 As Unit unit2 = extrudeBuilder1.Draft.FrontDraftAngle.Units Dim expression5 As Expression expression5 = workPart.Expressions.CreateSystemExpressionWithUnits("2.00", unit2) extrudeBuilder1.DistanceTolerance = 0.0254 extrudeBuilder1.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies3(0) As Body targetBodies3(0) = nullBody extrudeBuilder1.BooleanOperation.SetTargetBodies(targetBodies3) extrudeBuilder1.Limits.StartExtend.Value.RightHandSide = "0" extrudeBuilder1.Limits.EndExtend.Value.RightHandSide = "47" extrudeBuilder1.Draft.FrontDraftAngle.RightHandSide = "2" extrudeBuilder1.Draft.BackDraftAngle.RightHandSide = "2" extrudeBuilder1.Offset.StartOffset.RightHandSide = "0" extrudeBuilder1.Offset.EndOffset.RightHandSide = "5" Dim smartVolumeProfileBuilder1 As GeometricUtilities.SmartVolumeProfileBuilder smartVolumeProfileBuilder1 = extrudeBuilder1.SmartVolumeProfile smartVolumeProfileBuilder1.OpenProfileSmartVolumeOption = False smartVolumeProfileBuilder1.CloseProfileRule = GeometricUtilities.SmartVolumeProfileBuilder.CloseProfileRuleType.Fci theSession.SetUndoMarkName(markId9, "Extrudierter Körper-Dialogfenster") section1.DistanceTolerance = 0.0254 section1.ChainingTolerance = 0.02413 section1.SetAllowedEntityTypes(Section.AllowTypes.OnlyCurves) Dim markId10 As Session.UndoMarkId markId10 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, Nothing) Dim curves1(0) As ICurve curves1(0) = arc1 Dim seedPoint1 As Point3d = New Point3d(22.7288572260223, 10.9456407545524, 0.0) Dim regionBoundaryRule1 As RegionBoundaryRule regionBoundaryRule1 = workPart.ScRuleFactory.CreateRuleRegionBoundary(theSession.ActiveSketch, curves1, seedPoint1, 0.0254) section1.AllowSelfIntersection(True) Dim rules1(0) As SelectionIntentRule rules1(0) = regionBoundaryRule1 Dim helpPoint1 As Point3d = New Point3d(0.0, 0.0, 0.0) section1.AddToSection(rules1, nullNXObject, nullNXObject, nullNXObject, helpPoint1, Section.Mode.Create, False) theSession.DeleteUndoMark(markId10, Nothing) Dim markId11 As Session.UndoMarkId markId11 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "section mark") Dim markId12 As Session.UndoMarkId markId12 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, Nothing) theSession.DeleteUndoMark(markId12, Nothing) Dim direction1 As Direction direction1 = workPart.Directions.CreateDirection(theSession.ActiveSketch, Sense.Forward, SmartObject.UpdateOption.WithinModeling) extrudeBuilder1.Direction = direction1 theSession.DeleteUndoMark(markId11, Nothing) Dim rotMatrix1 As Matrix3x3 rotMatrix1.Xx = 0.913716723939831 rotMatrix1.Xy = -0.092950935179336 rotMatrix1.Xz = 0.395577896301032 rotMatrix1.Yx = -0.209451495875944 rotMatrix1.Yy = 0.726471284061011 rotMatrix1.Yz = 0.654499460893647 rotMatrix1.Zx = -0.3482123192364 rotMatrix1.Zy = -0.680881485343839 rotMatrix1.Zz = 0.64432024929221 Dim translation1 As Point3d = New Point3d(-9.29608056307426, -15.3807373310007, 8.35847414163308) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix1, translation1, 0.99086803594195) extrudeBuilder1.Limits.EndExtend.Value.RightHandSide = "65" Dim markId13 As Session.UndoMarkId markId13 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") theSession.DeleteUndoMark(markId13, Nothing) Dim markId14 As Session.UndoMarkId markId14 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") extrudeBuilder1.ParentFeatureInternal = False theSession.ActiveSketch.Deactivate(Sketch.ViewReorient.False, Sketch.UpdateLevel.SketchOnly) Dim feature2 As Features.Feature feature2 = extrudeBuilder1.CommitFeature() theSession.DeleteUndoMark(markId14, Nothing) theSession.SetUndoMarkName(markId9, "Extrudierter Körper") Dim expression6 As Expression = extrudeBuilder1.Limits.StartExtend.Value Dim expression7 As Expression = extrudeBuilder1.Limits.EndExtend.Value extrudeBuilder1.Destroy() workPart.Expressions.Delete(expression5) Dim markId15 As Session.UndoMarkId markId15 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Make Sketch Internal") Dim extrude1 As Features.Extrude = CType(feature2, Features.Extrude) extrude1.MakeSketchInternal() ' ---------------------------------------------- ' Menü: Einfügen->Bezug/Punkt->Bezugsebene... ' ---------------------------------------------- Dim markId16 As Session.UndoMarkId markId16 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim datumPlaneBuilder1 As Features.DatumPlaneBuilder datumPlaneBuilder1 = workPart.Features.CreateDatumPlaneBuilder(nullFeatures_Feature) Dim plane1 As Plane plane1 = datumPlaneBuilder1.GetPlane() Dim expression8 As Expression expression8 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression9 As Expression expression9 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim coordinates1 As Point3d = New Point3d(0.0, 0.0, 0.0) Dim point3 As Point point3 = workPart.Points.CreatePoint(coordinates1) theSession.SetUndoMarkName(markId16, "Bezugsebene-Dialogfenster") plane1.SetUpdateOption(SmartObject.UpdateOption.WithinModeling) ' ---------------------------------------------- ' Menü: Einfügen->Sketch... ' ---------------------------------------------- datumPlaneBuilder1.Destroy() Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression9) Catch ex As NXException ex.AssertErrorCode(1050029) End Try Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression8) Catch ex As NXException ex.AssertErrorCode(1050029) End Try theSession.UndoToMark(markId16, Nothing) theSession.DeleteUndoMark(markId16, Nothing) Dim markId17 As Session.UndoMarkId markId17 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim sketchInPlaceBuilder2 As SketchInPlaceBuilder sketchInPlaceBuilder2 = workPart.Sketches.CreateNewSketchInPlaceBuilder(nullSketch) Dim expression10 As Expression expression10 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression11 As Expression expression11 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim sketchAlongPathBuilder2 As SketchAlongPathBuilder sketchAlongPathBuilder2 = workPart.Sketches.CreateSketchAlongPathBuilder(nullSketch) sketchAlongPathBuilder2.PlaneLocation.Expression.RightHandSide = "0" theSession.SetUndoMarkName(markId17, "Skizze erzeugen-Dialogfenster") Dim edge1 As Edge = CType(extrude1.FindObject("EDGE * 130 * 140 {(-21,36.3730669589464,65)(42,0,65)(-21,-36.3730669589464,65) EXTRUDE(1)}"), Edge) Dim point4 As Point point4 = workPart.Points.CreatePoint(edge1, SmartObject.UpdateOption.WithinModeling) Dim face1 As Face = CType(extrude1.FindObject("FACE 130 {(0,0,65) EXTRUDE(1)}"), Face) Dim point5 As Point3d = New Point3d(-3.53974501076427, 6.80074336625233, 65.0) sketchInPlaceBuilder2.PlaneOrFace.SetValue(face1, workPart.ModelingViews.WorkView, point5) sketchInPlaceBuilder2.SketchOrigin = point4 Dim point6 As Point point6 = workPart.Points.CreatePoint(edge1, SmartObject.UpdateOption.WithinModeling) sketchInPlaceBuilder2.PlaneOrFace.Value = Nothing sketchInPlaceBuilder2.PlaneOrFace.Value = face1 sketchInPlaceBuilder2.Axis.Value = datumAxis1 Dim nErrs2 As Integer nErrs2 = theSession.UpdateManager.AddToDeleteList(point4) Dim markId18 As Session.UndoMarkId markId18 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.DeleteUndoMark(markId18, Nothing) Dim markId19 As Session.UndoMarkId markId19 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.Preferences.Sketch.CreateInferredConstraints = True theSession.Preferences.Sketch.ContinuousAutoDimensioning = True theSession.Preferences.Sketch.DimensionLabel = Preferences.SketchPreferences.DimensionLabelType.Expression theSession.Preferences.Sketch.TextSizeFixed = True theSession.Preferences.Sketch.FixedTextSize = 3.0 theSession.Preferences.Sketch.ConstraintSymbolSize = 3.0 theSession.Preferences.Sketch.DisplayObjectColor = False theSession.Preferences.Sketch.DisplayObjectName = True Dim nXObject2 As NXObject nXObject2 = sketchInPlaceBuilder2.Commit() Dim sketch2 As Sketch = CType(nXObject2, Sketch) Dim feature3 As Features.Feature feature3 = sketch2.Feature Dim markId20 As Session.UndoMarkId markId20 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "update") Dim nErrs3 As Integer nErrs3 = theSession.UpdateManager.DoUpdate(markId20) sketch2.Activate(Sketch.ViewReorient.True) theSession.DeleteUndoMark(markId19, Nothing) theSession.SetUndoMarkName(markId17, "Skizze erzeugen") sketchInPlaceBuilder2.Destroy() sketchAlongPathBuilder2.Destroy() workPart.Points.DeletePoint(point6) Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression11) Catch ex As NXException ex.AssertErrorCode(1050029) End Try Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression10) Catch ex As NXException ex.AssertErrorCode(1050029) End Try ' ---------------------------------------------- ' Menü: Einfügen->Kurve skizzieren->Kreis... ' ---------------------------------------------- Dim markId21 As Session.UndoMarkId markId21 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") Dim markId22 As Session.UndoMarkId markId22 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") Dim expression12 As Expression expression12 = workPart.Expressions.CreateSystemExpression("45") theSession.SetUndoMarkVisibility(markId22, "Curve", Session.MarkVisibility.Visible) Dim nXMatrix2 As NXMatrix nXMatrix2 = theSession.ActiveSketch.Orientation Dim center2 As Point3d = New Point3d(0.0, 0.0, 65.0) Dim arc2 As Arc arc2 = workPart.Curves.CreateArc(center2, nXMatrix2, 22.5, 0.0, ( 360.0 * Math.Pi/180.0 )) theSession.ActiveSketch.AddGeometry(arc2, Sketch.InferConstraintsOption.InferNoConstraints) Dim geom1_2 As Sketch.ConstraintGeometry geom1_2.Geometry = arc2 geom1_2.PointType = Sketch.ConstraintPointType.ArcCenter geom1_2.SplineDefiningPointIndex = 0 Dim geom2_2 As Sketch.ConstraintGeometry Dim datumCsys2 As Features.DatumCsys = CType(workPart.Features.FindObject("SKETCH(2:1B)"), Features.DatumCsys) Dim point7 As Point = CType(datumCsys2.FindObject("POINT 1"), Point) geom2_2.Geometry = point7 geom2_2.PointType = Sketch.ConstraintPointType.None geom2_2.SplineDefiningPointIndex = 0 Dim sketchGeometricConstraint2 As SketchGeometricConstraint sketchGeometricConstraint2 = theSession.ActiveSketch.CreateCoincidentConstraint(geom1_2, geom2_2) Dim dimObject1_2 As Sketch.DimensionGeometry dimObject1_2.Geometry = arc2 dimObject1_2.AssocType = Sketch.AssocType.Midpoint dimObject1_2.AssocValue = 0 dimObject1_2.HelpPoint.X = 0.0 dimObject1_2.HelpPoint.Y = 0.0 dimObject1_2.HelpPoint.Z = 0.0 dimObject1_2.View = nullNXObject Dim dimOrigin2 As Point3d = New Point3d(0.0, 3.02764837615143, 65.0) Dim sketchDimensionalConstraint2 As SketchDimensionalConstraint sketchDimensionalConstraint2 = theSession.ActiveSketch.CreateDiameterDimension(dimObject1_2, dimOrigin2, expression12, Sketch.DimensionOption.CreateAsDriving) Dim dimension2 As Annotations.Dimension dimension2 = sketchDimensionalConstraint2.AssociatedDimension theSession.ActiveSketch.Update() Dim markId23 As Session.UndoMarkId markId23 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menü: Datei->Skizze beenden ' ---------------------------------------------- theSession.DeleteUndoMark(markId23, "Curve") theSession.ActiveSketch.Deactivate(Sketch.ViewReorient.False, Sketch.UpdateLevel.Model) ' ---------------------------------------------- ' Menü: Einfügen->Konstruktionsformelement->Extrudieren... ' ---------------------------------------------- Dim markId24 As Session.UndoMarkId markId24 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim extrudeBuilder2 As Features.ExtrudeBuilder extrudeBuilder2 = workPart.Features.CreateExtrudeBuilder(nullFeatures_Feature) Dim section2 As Section section2 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5) extrudeBuilder2.Section = section2 extrudeBuilder2.AllowSelfIntersectingSection(True) Dim expression13 As Expression expression13 = workPart.Expressions.CreateSystemExpressionWithUnits("2.00", unit2) extrudeBuilder2.DistanceTolerance = 0.0254 extrudeBuilder2.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies4(0) As Body targetBodies4(0) = nullBody extrudeBuilder2.BooleanOperation.SetTargetBodies(targetBodies4) extrudeBuilder2.Limits.StartExtend.Value.RightHandSide = "0" extrudeBuilder2.Limits.EndExtend.Value.RightHandSide = "65" extrudeBuilder2.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies5(0) As Body targetBodies5(0) = nullBody extrudeBuilder2.BooleanOperation.SetTargetBodies(targetBodies5) extrudeBuilder2.Draft.FrontDraftAngle.RightHandSide = "2" extrudeBuilder2.Draft.BackDraftAngle.RightHandSide = "2" extrudeBuilder2.Offset.StartOffset.RightHandSide = "0" extrudeBuilder2.Offset.EndOffset.RightHandSide = "5" Dim smartVolumeProfileBuilder2 As GeometricUtilities.SmartVolumeProfileBuilder smartVolumeProfileBuilder2 = extrudeBuilder2.SmartVolumeProfile smartVolumeProfileBuilder2.OpenProfileSmartVolumeOption = False smartVolumeProfileBuilder2.CloseProfileRule = GeometricUtilities.SmartVolumeProfileBuilder.CloseProfileRuleType.Fci theSession.SetUndoMarkName(markId24, "Extrudierter Körper-Dialogfenster") section2.DistanceTolerance = 0.0254 section2.ChainingTolerance = 0.02413 section2.SetAllowedEntityTypes(Section.AllowTypes.OnlyCurves) Dim markId25 As Session.UndoMarkId markId25 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "section mark") Dim markId26 As Session.UndoMarkId markId26 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, Nothing) Dim features1(0) As Features.Feature Dim sketchFeature1 As Features.SketchFeature = CType(feature3, Features.SketchFeature) features1(0) = sketchFeature1 Dim curveFeatureRule1 As CurveFeatureRule curveFeatureRule1 = workPart.ScRuleFactory.CreateRuleCurveFeature(features1) section2.AllowSelfIntersection(True) Dim rules2(0) As SelectionIntentRule rules2(0) = curveFeatureRule1 Dim helpPoint2 As Point3d = New Point3d(-8.71945271038523, 20.7276564145502, 65.0) section2.AddToSection(rules2, arc2, nullNXObject, nullNXObject, helpPoint2, Section.Mode.Create, False) theSession.DeleteUndoMark(markId26, Nothing) Dim direction2 As Direction direction2 = workPart.Directions.CreateDirection(sketch2, Sense.Forward, SmartObject.UpdateOption.WithinModeling) extrudeBuilder2.Direction = direction2 Dim targetBodies6(0) As Body Dim body1 As Body = CType(workPart.Bodies.FindObject("EXTRUDE(1)"), Body) targetBodies6(0) = body1 extrudeBuilder2.BooleanOperation.SetTargetBodies(targetBodies6) extrudeBuilder2.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Unite Dim targetBodies7(0) As Body targetBodies7(0) = body1 extrudeBuilder2.BooleanOperation.SetTargetBodies(targetBodies7) theSession.DeleteUndoMark(markId25, Nothing) Dim rotMatrix2 As Matrix3x3 rotMatrix2.Xx = 0.855471662881164 rotMatrix2.Xy = -0.0 rotMatrix2.Xz = 0.517849624898326 rotMatrix2.Yx = 0.0 rotMatrix2.Yy = 1.0 rotMatrix2.Yz = 0.0 rotMatrix2.Zx = -0.517849624898326 rotMatrix2.Zy = 0.0 rotMatrix2.Zz = 0.855471662881164 Dim translation2 As Point3d = New Point3d(-33.6602256183912, 0.0, -55.6056580872757) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix2, translation2, 0.99086803594195) extrudeBuilder2.Limits.EndExtend.Value.RightHandSide = "47" extrudeBuilder2.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Unite Dim targetBodies8(0) As Body targetBodies8(0) = body1 extrudeBuilder2.BooleanOperation.SetTargetBodies(targetBodies8) Dim markId27 As Session.UndoMarkId markId27 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") theSession.DeleteUndoMark(markId27, Nothing) Dim markId28 As Session.UndoMarkId markId28 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") extrudeBuilder2.ParentFeatureInternal = False Dim feature4 As Features.Feature feature4 = extrudeBuilder2.CommitFeature() theSession.DeleteUndoMark(markId28, Nothing) theSession.SetUndoMarkName(markId24, "Extrudierter Körper") Dim expression14 As Expression = extrudeBuilder2.Limits.StartExtend.Value Dim expression15 As Expression = extrudeBuilder2.Limits.EndExtend.Value extrudeBuilder2.Destroy() workPart.Expressions.Delete(expression13) Dim rotMatrix3 As Matrix3x3 rotMatrix3.Xx = -0.589035061402575 rotMatrix3.Xy = 0.00162608843184257 rotMatrix3.Xz = 0.808105842247708 rotMatrix3.Yx = 0.0134287731107813 rotMatrix3.Yy = 0.99987959085502 rotMatrix3.Yz = 0.00777636446788517 rotMatrix3.Zx = -0.807995893857886 rotMatrix3.Zy = 0.0154324213268709 rotMatrix3.Zz = -0.588985972567077 Dim translation3 As Point3d = New Point3d(-49.9145737899566, -0.435476410201569, 25.2839694978258) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix3, translation3, 0.99086803594195) Dim markId29 As Session.UndoMarkId markId29 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Make Sketch Internal") Dim extrude2 As Features.Extrude = CType(feature4, Features.Extrude) extrude2.MakeSketchInternal() ' ---------------------------------------------- ' Menü: Einfügen->Sketch... ' ---------------------------------------------- Dim markId30 As Session.UndoMarkId markId30 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim sketchInPlaceBuilder3 As SketchInPlaceBuilder sketchInPlaceBuilder3 = workPart.Sketches.CreateNewSketchInPlaceBuilder(nullSketch) Dim expression16 As Expression expression16 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression17 As Expression expression17 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim sketchAlongPathBuilder3 As SketchAlongPathBuilder sketchAlongPathBuilder3 = workPart.Sketches.CreateSketchAlongPathBuilder(nullSketch) sketchAlongPathBuilder3.PlaneLocation.Expression.RightHandSide = "0" theSession.SetUndoMarkName(markId30, "Skizze erzeugen-Dialogfenster") Dim edge2 As Edge = CType(extrude1.FindObject("EDGE * 120 * 140 {(-21,36.3730669589464,0)(42,0,0)(-21,-36.3730669589464,0) EXTRUDE(1)}"), Edge) Dim point8 As Point point8 = workPart.Points.CreatePoint(edge2, SmartObject.UpdateOption.WithinModeling) Dim face2 As Face = CType(extrude1.FindObject("FACE 120 {(0,0,0) EXTRUDE(1)}"), Face) Dim point9 As Point3d = New Point3d(-16.6629713633176, 28.4329269732282, 0.0) sketchInPlaceBuilder3.PlaneOrFace.SetValue(face2, workPart.ModelingViews.WorkView, point9) sketchInPlaceBuilder3.SketchOrigin = point8 Dim point10 As Point point10 = workPart.Points.CreatePoint(edge2, SmartObject.UpdateOption.WithinModeling) sketchInPlaceBuilder3.PlaneOrFace.Value = Nothing sketchInPlaceBuilder3.PlaneOrFace.Value = face2 sketchInPlaceBuilder3.Axis.Value = datumAxis1 Dim nErrs4 As Integer nErrs4 = theSession.UpdateManager.AddToDeleteList(point8) Dim markId31 As Session.UndoMarkId markId31 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.DeleteUndoMark(markId31, Nothing) Dim markId32 As Session.UndoMarkId markId32 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Skizze erzeugen") theSession.Preferences.Sketch.CreateInferredConstraints = True theSession.Preferences.Sketch.ContinuousAutoDimensioning = True theSession.Preferences.Sketch.DimensionLabel = Preferences.SketchPreferences.DimensionLabelType.Expression theSession.Preferences.Sketch.TextSizeFixed = True theSession.Preferences.Sketch.FixedTextSize = 3.0 theSession.Preferences.Sketch.ConstraintSymbolSize = 3.0 theSession.Preferences.Sketch.DisplayObjectColor = False theSession.Preferences.Sketch.DisplayObjectName = True Dim nXObject3 As NXObject nXObject3 = sketchInPlaceBuilder3.Commit() Dim sketch3 As Sketch = CType(nXObject3, Sketch) Dim feature5 As Features.Feature feature5 = sketch3.Feature Dim markId33 As Session.UndoMarkId markId33 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "update") Dim nErrs5 As Integer nErrs5 = theSession.UpdateManager.DoUpdate(markId33) sketch3.Activate(Sketch.ViewReorient.True) theSession.DeleteUndoMark(markId32, Nothing) theSession.SetUndoMarkName(markId30, "Skizze erzeugen") sketchInPlaceBuilder3.Destroy() sketchAlongPathBuilder3.Destroy() workPart.Points.DeletePoint(point10) Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression17) Catch ex As NXException ex.AssertErrorCode(1050029) End Try Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression16) Catch ex As NXException ex.AssertErrorCode(1050029) End Try ' ---------------------------------------------- ' Menü: Einfügen->Kurve skizzieren->Kreis... ' ---------------------------------------------- Dim markId34 As Session.UndoMarkId markId34 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Profile short list") Dim markId35 As Session.UndoMarkId markId35 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") Dim expression18 As Expression expression18 = workPart.Expressions.CreateSystemExpression("45") theSession.SetUndoMarkVisibility(markId35, "Curve", Session.MarkVisibility.Visible) Dim nXMatrix3 As NXMatrix nXMatrix3 = theSession.ActiveSketch.Orientation Dim center3 As Point3d = New Point3d(0.0, 0.0, 0.0) Dim arc3 As Arc arc3 = workPart.Curves.CreateArc(center3, nXMatrix3, 22.5, 0.0, ( 360.0 * Math.Pi/180.0 )) theSession.ActiveSketch.AddGeometry(arc3, Sketch.InferConstraintsOption.InferNoConstraints) Dim geom1_3 As Sketch.ConstraintGeometry geom1_3.Geometry = arc3 geom1_3.PointType = Sketch.ConstraintPointType.ArcCenter geom1_3.SplineDefiningPointIndex = 0 Dim geom2_3 As Sketch.ConstraintGeometry geom2_3.Geometry = point2 geom2_3.PointType = Sketch.ConstraintPointType.None geom2_3.SplineDefiningPointIndex = 0 Dim sketchGeometricConstraint3 As SketchGeometricConstraint sketchGeometricConstraint3 = theSession.ActiveSketch.CreateCoincidentConstraint(geom1_3, geom2_3) Dim geom1_4 As Sketch.ConstraintGeometry geom1_4.Geometry = arc3 geom1_4.PointType = Sketch.ConstraintPointType.None geom1_4.SplineDefiningPointIndex = 0 Dim geom1Help1 As Sketch.ConstraintGeometryHelp geom1Help1.Type = Sketch.ConstraintGeometryHelpType.Point geom1Help1.Point.X = -11.25 geom1Help1.Point.Y = 19.4855715851499 geom1Help1.Point.Z = 0.0 geom1Help1.Parameter = 0.0 Dim geom2_4 As Sketch.ConstraintGeometry Dim edge3 As Edge = CType(extrude2.FindObject("EDGE * 130 * 140 {(-11.25,19.4855715851499,112)(22.5,0,112)(-11.25,-19.4855715851499,112) EXTRUDE(1)}"), Edge) geom2_4.Geometry = edge3 geom2_4.PointType = Sketch.ConstraintPointType.None geom2_4.SplineDefiningPointIndex = 0 Dim geom2Help1 As Sketch.ConstraintGeometryHelp geom2Help1.Type = Sketch.ConstraintGeometryHelpType.Point geom2Help1.Point.X = -11.25 geom2Help1.Point.Y = 19.4855715851499 geom2Help1.Point.Z = 0.0 geom2Help1.Parameter = 0.0 Dim sketchTangentConstraint1 As SketchTangentConstraint sketchTangentConstraint1 = theSession.ActiveSketch.CreateTangentConstraint(geom1_4, geom1Help1, geom2_4, geom2Help1) Dim geom1_5 As Sketch.ConstraintGeometry geom1_5.Geometry = arc3 geom1_5.PointType = Sketch.ConstraintPointType.None geom1_5.SplineDefiningPointIndex = 0 Dim geom1Help2 As Sketch.ConstraintGeometryHelp geom1Help2.Type = Sketch.ConstraintGeometryHelpType.Point geom1Help2.Point.X = -11.25 geom1Help2.Point.Y = 19.4855715851499 geom1Help2.Point.Z = 0.0 geom1Help2.Parameter = 0.0 Dim geom2_5 As Sketch.ConstraintGeometry Dim edge4 As Edge = CType(extrude2.FindObject("EDGE * 140 EXTRUDE(1) 130 {(-11.25,19.4855715851499,65)(22.5,0,65)(-11.25,-19.4855715851499,65) EXTRUDE(1)}"), Edge) geom2_5.Geometry = edge4 geom2_5.PointType = Sketch.ConstraintPointType.None geom2_5.SplineDefiningPointIndex = 0 Dim geom2Help2 As Sketch.ConstraintGeometryHelp geom2Help2.Type = Sketch.ConstraintGeometryHelpType.Point geom2Help2.Point.X = -11.25 geom2Help2.Point.Y = 19.4855715851499 geom2Help2.Point.Z = 0.0 geom2Help2.Parameter = 0.0 Dim sketchTangentConstraint2 As SketchTangentConstraint sketchTangentConstraint2 = theSession.ActiveSketch.CreateTangentConstraint(geom1_5, geom1Help2, geom2_5, geom2Help2) Dim dimObject1_3 As Sketch.DimensionGeometry dimObject1_3.Geometry = arc3 dimObject1_3.AssocType = Sketch.AssocType.Midpoint dimObject1_3.AssocValue = 0 dimObject1_3.HelpPoint.X = 0.0 dimObject1_3.HelpPoint.Y = 0.0 dimObject1_3.HelpPoint.Z = 0.0 dimObject1_3.View = nullNXObject Dim dimOrigin3 As Point3d = New Point3d(0.0, -3.02764837615143, 0.0) Dim sketchDimensionalConstraint3 As SketchDimensionalConstraint sketchDimensionalConstraint3 = theSession.ActiveSketch.CreateDiameterDimension(dimObject1_3, dimOrigin3, expression18, Sketch.DimensionOption.CreateAsDriving) Dim dimension3 As Annotations.Dimension dimension3 = sketchDimensionalConstraint3.AssociatedDimension theSession.ActiveSketch.Update() Dim markId36 As Session.UndoMarkId markId36 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Curve") ' ---------------------------------------------- ' Menü: Datei->Skizze beenden ' ---------------------------------------------- theSession.DeleteUndoMark(markId36, "Curve") theSession.ActiveSketch.Deactivate(Sketch.ViewReorient.False, Sketch.UpdateLevel.Model) ' ---------------------------------------------- ' Menü: Einfügen->Konstruktionsformelement->Extrudieren... ' ---------------------------------------------- Dim markId37 As Session.UndoMarkId markId37 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim extrudeBuilder3 As Features.ExtrudeBuilder extrudeBuilder3 = workPart.Features.CreateExtrudeBuilder(nullFeatures_Feature) Dim section3 As Section section3 = workPart.Sections.CreateSection(0.02413, 0.0254, 0.5) extrudeBuilder3.Section = section3 extrudeBuilder3.AllowSelfIntersectingSection(True) Dim expression19 As Expression expression19 = workPart.Expressions.CreateSystemExpressionWithUnits("2.00", unit2) extrudeBuilder3.DistanceTolerance = 0.0254 extrudeBuilder3.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies9(0) As Body targetBodies9(0) = nullBody extrudeBuilder3.BooleanOperation.SetTargetBodies(targetBodies9) extrudeBuilder3.Limits.StartExtend.Value.RightHandSide = "0" extrudeBuilder3.Limits.EndExtend.Value.RightHandSide = "47" extrudeBuilder3.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Create Dim targetBodies10(0) As Body targetBodies10(0) = nullBody extrudeBuilder3.BooleanOperation.SetTargetBodies(targetBodies10) extrudeBuilder3.Draft.FrontDraftAngle.RightHandSide = "2" extrudeBuilder3.Draft.BackDraftAngle.RightHandSide = "2" extrudeBuilder3.Offset.StartOffset.RightHandSide = "0" extrudeBuilder3.Offset.EndOffset.RightHandSide = "5" Dim smartVolumeProfileBuilder3 As GeometricUtilities.SmartVolumeProfileBuilder smartVolumeProfileBuilder3 = extrudeBuilder3.SmartVolumeProfile smartVolumeProfileBuilder3.OpenProfileSmartVolumeOption = False smartVolumeProfileBuilder3.CloseProfileRule = GeometricUtilities.SmartVolumeProfileBuilder.CloseProfileRuleType.Fci theSession.SetUndoMarkName(markId37, "Extrudierter Körper-Dialogfenster") section3.DistanceTolerance = 0.0254 section3.ChainingTolerance = 0.02413 section3.SetAllowedEntityTypes(Section.AllowTypes.OnlyCurves) Dim markId38 As Session.UndoMarkId markId38 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "section mark") Dim markId39 As Session.UndoMarkId markId39 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, Nothing) Dim features2(0) As Features.Feature Dim sketchFeature2 As Features.SketchFeature = CType(feature5, Features.SketchFeature) features2(0) = sketchFeature2 Dim curveFeatureRule2 As CurveFeatureRule curveFeatureRule2 = workPart.ScRuleFactory.CreateRuleCurveFeature(features2) section3.AllowSelfIntersection(True) Dim rules3(0) As SelectionIntentRule rules3(0) = curveFeatureRule2 Dim helpPoint3 As Point3d = New Point3d(-4.99530504541766, -21.9224025745487, 0.0) section3.AddToSection(rules3, arc3, nullNXObject, nullNXObject, helpPoint3, Section.Mode.Create, False) theSession.DeleteUndoMark(markId39, Nothing) Dim direction3 As Direction direction3 = workPart.Directions.CreateDirection(sketch3, Sense.Forward, SmartObject.UpdateOption.WithinModeling) extrudeBuilder3.Direction = direction3 Dim targetBodies11(0) As Body targetBodies11(0) = body1 extrudeBuilder3.BooleanOperation.SetTargetBodies(targetBodies11) extrudeBuilder3.BooleanOperation.Type = GeometricUtilities.BooleanOperation.BooleanType.Unite Dim targetBodies12(0) As Body targetBodies12(0) = body1 extrudeBuilder3.BooleanOperation.SetTargetBodies(targetBodies12) theSession.DeleteUndoMark(markId38, Nothing) Dim rotMatrix4 As Matrix3x3 rotMatrix4.Xx = 0.874954608038976 rotMatrix4.Xy = 0.0 rotMatrix4.Xz = 0.484204950275565 rotMatrix4.Yx = 0.0 rotMatrix4.Yy = -1.0 rotMatrix4.Yz = 0.0 rotMatrix4.Zx = 0.484204950275565 rotMatrix4.Zy = 0.0 rotMatrix4.Zz = -0.874954608038976 Dim translation4 As Point3d = New Point3d(-15.7366608839559, 0.0, -4.06397523873329) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix4, translation4, 0.99086803594195) Dim markId40 As Session.UndoMarkId markId40 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") theSession.DeleteUndoMark(markId40, Nothing) Dim markId41 As Session.UndoMarkId markId41 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Extrudierter Körper") extrudeBuilder3.ParentFeatureInternal = False Dim feature6 As Features.Feature feature6 = extrudeBuilder3.CommitFeature() theSession.DeleteUndoMark(markId41, Nothing) theSession.SetUndoMarkName(markId37, "Extrudierter Körper") Dim expression20 As Expression = extrudeBuilder3.Limits.StartExtend.Value Dim expression21 As Expression = extrudeBuilder3.Limits.EndExtend.Value extrudeBuilder3.Destroy() workPart.Expressions.Delete(expression19) Dim rotMatrix5 As Matrix3x3 rotMatrix5.Xx = 0.559425995707696 rotMatrix5.Xy = 0.0506627365825835 rotMatrix5.Xz = 0.827330552106241 rotMatrix5.Yx = -0.166982568423988 rotMatrix5.Yy = -0.97077788513495 rotMatrix5.Yz = 0.172357534141802 rotMatrix5.Zx = 0.811886308031476 rotMatrix5.Zy = -0.234571065681337 rotMatrix5.Zz = -0.534618591124683 Dim translation5 As Point3d = New Point3d(-26.8882429434528, -5.60161985960858, -15.1248957884478) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix5, translation5, 0.99086803594195) Dim markId42 As Session.UndoMarkId markId42 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Make Sketch Internal") Dim extrude3 As Features.Extrude = CType(feature6, Features.Extrude) extrude3.MakeSketchInternal() ' ---------------------------------------------- ' Menü: Darstellungsformat->Schattiert mit Kanten ' ---------------------------------------------- workPart.ModelingViews.WorkView.RenderingStyle = View.RenderingStyleType.ShadedWithEdges ' ---------------------------------------------- ' Menü: Einfügen->Detailformelement->Edge Blend... ' ---------------------------------------------- Dim markId43 As Session.UndoMarkId markId43 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim edgeBlendBuilder1 As Features.EdgeBlendBuilder edgeBlendBuilder1 = workPart.Features.CreateEdgeBlendBuilder(nullFeatures_Feature) Dim expression22 As Expression expression22 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression23 As Expression expression23 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim blendLimitsData1 As GeometricUtilities.BlendLimitsData blendLimitsData1 = edgeBlendBuilder1.LimitsListData Dim origin1 As Point3d = New Point3d(0.0, 0.0, 0.0) Dim normal1 As Vector3d = New Vector3d(0.0, 0.0, 1.0) Dim plane2 As Plane plane2 = workPart.Planes.CreatePlane(origin1, normal1, SmartObject.UpdateOption.WithinModeling) Dim facePlaneSelectionBuilder1 As GeometricUtilities.FacePlaneSelectionBuilder facePlaneSelectionBuilder1 = workPart.FacePlaneSelectionBuilderData.Create() Dim expression24 As Expression expression24 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) Dim expression25 As Expression expression25 = workPart.Expressions.CreateSystemExpressionWithUnits("0", unit1) theSession.SetUndoMarkName(markId43, "Kantenverrundung-Dialogfenster") Dim scCollector1 As ScCollector scCollector1 = workPart.ScCollectors.CreateCollector() Dim seedEdges1(0) As Edge Dim edge5 As Edge = CType(extrude3.FindObject("EDGE * 140 EXTRUDE(1) 120 {(-11.25,-19.4855715851499,0)(22.5,0,0)(-11.25,19.4855715851499,0) EXTRUDE(1)}"), Edge) seedEdges1(0) = edge5 Dim edgeMultipleSeedTangentRule1 As EdgeMultipleSeedTangentRule edgeMultipleSeedTangentRule1 = workPart.ScRuleFactory.CreateRuleEdgeMultipleSeedTangent(seedEdges1, 0.5, True) Dim rules4(0) As SelectionIntentRule rules4(0) = edgeMultipleSeedTangentRule1 scCollector1.ReplaceRules(rules4, False) Dim rotMatrix6 As Matrix3x3 rotMatrix6.Xx = -0.372779823479023 rotMatrix6.Xy = 0.226116723305798 rotMatrix6.Xz = 0.899948015525562 rotMatrix6.Yx = -0.17459965640354 rotMatrix6.Yy = -0.969624303761694 rotMatrix6.Yz = 0.171299940275574 rotMatrix6.Zx = 0.911345249173284 rotMatrix6.Zy = -0.0932734527939154 rotMatrix6.Zz = 0.400936278993541 Dim translation6 As Point3d = New Point3d(-29.2483105045808, -5.56724805895616, -45.5304290672901) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix6, translation6, 0.99086803594195) Dim seedEdges2(1) As Edge seedEdges2(0) = edge5 seedEdges2(1) = edge4 Dim edgeMultipleSeedTangentRule2 As EdgeMultipleSeedTangentRule edgeMultipleSeedTangentRule2 = workPart.ScRuleFactory.CreateRuleEdgeMultipleSeedTangent(seedEdges2, 0.5, True) Dim rules5(0) As SelectionIntentRule rules5(0) = edgeMultipleSeedTangentRule2 scCollector1.ReplaceRules(rules5, False) Dim markId44 As Session.UndoMarkId markId44 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Kantenverrundung") theSession.DeleteUndoMark(markId44, Nothing) Dim markId45 As Session.UndoMarkId markId45 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Kantenverrundung") edgeBlendBuilder1.Tolerance = 0.0254 edgeBlendBuilder1.AllInstancesOption = False edgeBlendBuilder1.RemoveSelfIntersection = True edgeBlendBuilder1.PatchComplexGeometryAreas = True edgeBlendBuilder1.LimitFailingAreas = True edgeBlendBuilder1.ConvexConcaveY = False edgeBlendBuilder1.RollOverSmoothEdge = True edgeBlendBuilder1.RollOntoEdge = True edgeBlendBuilder1.MoveSharpEdge = True edgeBlendBuilder1.TrimmingOption = False edgeBlendBuilder1.OverlapOption = Features.EdgeBlendBuilder.Overlap.AnyConvexityRollOver edgeBlendBuilder1.BlendOrder = Features.EdgeBlendBuilder.OrderOfBlending.ConvexFirst edgeBlendBuilder1.SetbackOption = Features.EdgeBlendBuilder.Setback.SeparateFromCorner Dim csIndex1 As Integer csIndex1 = edgeBlendBuilder1.AddChainset(scCollector1, "1") Dim feature7 As Features.Feature feature7 = edgeBlendBuilder1.CommitFeature() theSession.DeleteUndoMark(markId45, Nothing) theSession.SetUndoMarkName(markId43, "Kantenverrundung") workPart.FacePlaneSelectionBuilderData.Destroy(facePlaneSelectionBuilder1) Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression25) Catch ex As NXException ex.AssertErrorCode(1050029) End Try Try ' Ausdruck wird immer noch verwendet. workPart.Expressions.Delete(expression24) Catch ex As NXException ex.AssertErrorCode(1050029) End Try edgeBlendBuilder1.Destroy() workPart.Expressions.Delete(expression22) workPart.Expressions.Delete(expression23) ' ---------------------------------------------- ' Menü: Einfügen->Detailformelement->Fase... ' ---------------------------------------------- Dim markId46 As Session.UndoMarkId markId46 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Start") Dim chamferBuilder1 As Features.ChamferBuilder chamferBuilder1 = workPart.Features.CreateChamferBuilder(nullFeatures_Feature) chamferBuilder1.FirstOffsetExp.RightHandSide = "1" chamferBuilder1.SecondOffsetExp.RightHandSide = "1" chamferBuilder1.AngleExp.RightHandSide = "45" chamferBuilder1.Option = Features.ChamferBuilder.ChamferOption.SymmetricOffsets chamferBuilder1.Method = Features.ChamferBuilder.OffsetMethod.EdgesAlongFaces chamferBuilder1.FirstOffset = "1" chamferBuilder1.SecondOffset = "1" chamferBuilder1.Angle = "45" chamferBuilder1.Tolerance = 0.0254 theSession.SetUndoMarkName(markId46, "Fase-Dialogfenster") Dim scCollector2 As ScCollector scCollector2 = workPart.ScCollectors.CreateCollector() Dim nullEdge As Edge = Nothing Dim edgeTangentRule1 As EdgeTangentRule edgeTangentRule1 = workPart.ScRuleFactory.CreateRuleEdgeTangent(edge3, nullEdge, False, 0.5, False, False) Dim rules6(0) As SelectionIntentRule rules6(0) = edgeTangentRule1 scCollector2.ReplaceRules(rules6, False) chamferBuilder1.SmartCollector = scCollector2 Dim edgeTangentRule2 As EdgeTangentRule edgeTangentRule2 = workPart.ScRuleFactory.CreateRuleEdgeTangent(edge3, nullEdge, False, 0.5, False, False) Dim edge6 As Edge = CType(extrude3.FindObject("EDGE * 130 * 140 {(-11.25,-19.4855715851499,-47)(22.5,0,-47)(-11.25,19.4855715851499,-47) EXTRUDE(1)}"), Edge) Dim edgeTangentRule3 As EdgeTangentRule edgeTangentRule3 = workPart.ScRuleFactory.CreateRuleEdgeTangent(edge6, nullEdge, False, 0.5, False, False) Dim rules7(1) As SelectionIntentRule rules7(0) = edgeTangentRule2 rules7(1) = edgeTangentRule3 scCollector2.ReplaceRules(rules7, False) chamferBuilder1.SmartCollector = scCollector2 Dim markId47 As Session.UndoMarkId markId47 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Fase") theSession.DeleteUndoMark(markId47, Nothing) Dim markId48 As Session.UndoMarkId markId48 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Fase") Dim feature8 As Features.Feature feature8 = chamferBuilder1.CommitFeature() theSession.DeleteUndoMark(markId48, Nothing) theSession.SetUndoMarkName(markId46, "Fase") Dim expression26 As Expression = chamferBuilder1.FirstOffsetExp chamferBuilder1.Destroy() Dim rotMatrix7 As Matrix3x3 rotMatrix7.Xx = 0.297169737774492 rotMatrix7.Xy = -0.0120045994145866 rotMatrix7.Xz = 0.95474920086059 rotMatrix7.Yx = 0.39953709204455 rotMatrix7.Yy = 0.90973590301196 rotMatrix7.Yz = -0.112918992430849 rotMatrix7.Zx = -0.867214079124425 rotMatrix7.Zy = 0.415013826714134 rotMatrix7.Zz = 0.275142262483368 Dim translation7 As Point3d = New Point3d(-31.0293490279692, 3.6698672540026, -41.4421235307094) workPart.ModelingViews.WorkView.SetRotationTranslationScale(rotMatrix7, translation7, 0.99086803594195) ' ---------------------------------------------- ' Menü: Werkzeuge->Ausdrücke... ' ---------------------------------------------- theSession.Preferences.Modeling.UpdatePending = False ' ---------------------------------------------- ' Menü: Werkzeuge->Journal->Stopp ' ---------------------------------------------- End Sub End Module