Have a part document open and run the following. It creates a new sketch on
the XY plane and projects the x-axis and the origin.
Sub CreateSketch()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
Set oDef = oDoc.ComponentDefinition
' Get the XY work plane
Dim oXYPlane As WorkPlane
Set oXYPlane = oDef.WorkPlanes.Item(3)
' Create a new sketch on the XY plane
Dim oSketch As PlanarSketch
Set oSketch = oDef.Sketches.Add(oXYPlane)
' Get the X axis
Dim oXAxis As WorkAxis
Set oXAxis = oDef.WorkAxes.Item(1)
' Get the center point
Dim oOrigin As WorkPoint
Set oOrigin = oDef.WorkPoints.Item(1)
' Project the axis to the sketch
Dim oSketchLine As SketchLine
Set oSketchLine = oSketch.AddByProjectingEntity(oXAxis)
' Project the origin point to the sketch
Dim oSketchPoint As SketchPoint
Set oSketchPoint = oSketch.AddByProjectingEntity(oOrigin)
End Sub
Sanjay-
wrote in message news:5584669@discussion.autodesk.com...
I am new user for customizing and i just started exploring. I want to draw
new sketch by projecting the axis and centerpoint. Can you please help in
coding how to??