Hi, I'm trying to make sketeh based on Absolute XY.
Based on my coding, The datum axis displayed, but I don't want to make datum axis because datum Axis displayed at Model History.
Who has any idea to make absolute XY plane Sketch without datum axis?
Public Sub Make_Sketch_Absolute_XZ(Sketch_Name As String)
Dim mySketch As NXOpen.Tag
Dim sketchMtx(8) As Double
Dim sketchObjects(1) As NXOpen.Tag
Dim reference(1) As Integer
Dim origin1 As NXOpen.Point3d = New NXOpen.Point3d(0.0, 0.0, 0.0)
Dim normal1 As NXOpen.Vector3d = New NXOpen.Vector3d(0.0, -1.0, 0.0)
Dim plane1 As NXOpen.Plane = Nothing
plane1 = WorkPart.Planes.CreatePlane(origin1, normal1, NXOpen.SmartObject.UpdateOption.WithinModeling)
Dim Axis_Target As NXOpen.DatumAxis = Nothing
Axis_Target = WorkPart.Datums.CreateFixedDatumAxis(origin1, New Point3d(1, 0, 0))
sketchMtx(0) = 1
sketchMtx(1) = 0
sketchMtx(2) = 0
sketchMtx(3) = 0
sketchMtx(4) = 1
sketchMtx(5) = 0
sketchMtx(6) = 0 ' origin x
sketchMtx(7) = 0 ' origin y
sketchMtx(8) = 0 ' origin z
reference(0) = 1 ' Horizontal - "2" would be Vertical
reference(1) = 1 ' Start-to-End direction of ref, "-1" would reverse it
sketchObjects(0) = plane1.Tag ' DPlaneTags(0) ' Sketch Plane
sketchObjects(1) = Axis_Target.Tag 'DAxisTags(0) ' Horizontal Reference
theUfssession.Sket.InitializeSketch(Sketch_Name, mySketch)
If mySketch = NXOpen.Tag.Null Then
Try
theUfssession.Sket.CreateSketch(Sketch_Name, 1, sketchMtx, sketchObjects, reference, 1, mySketch)
Catch ex As Exception
theUfssession.Ui.OpenListingWindow()
theUfssession.Ui.WriteListingWindow("Failed: " & ex.ToString)
End Try
End If
End Sub
If you know how to do it
If you know how to do it interactively
try recording it.