Hi ALL,
the following macro i have recorded from the solidworks it isrunning fine but only problem is there
when it is excuted the dimension modify window is pop up everytime,so is there any way so that this will not pop up.
******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
'plane selection
boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE",-0.06360427614293, 0.03868728323699, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
'create circle
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#,-0.023045, 0.019656, 0#)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT",-0.01711713741461, 0.02558352601156, 0, False, 0, Nothing, 0)
Dim myDisplayDim As Object
Set myDisplayDim = Part.AddDimension2(-0.0211730622701,0.04336719653179, 0)
Part.ClearSelection2 True
'giving dimension
Dim myDimension As Object
Set myDimension = Part.Parameter("D1@Sketch2")
myDimension.SystemValue = 0.0413
Part.ClearSelection2 True
Part.SketchManager.InsertSketch True
End Sub
SolidworksApi macros
the following macro i have recorded from the solidworks it isrunning fine but only problem is there
when it is excuted the dimension modify window is pop up everytime,so is there any way so that this will not pop up.
******************************************************************************
Dim swApp As Object
Dim Part As Object
Dim boolstatus As Boolean
Dim longstatus As Long, longwarnings As Long
Sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Part.SketchManager.InsertSketch True
'plane selection
boolstatus = Part.Extension.SelectByID2("Front Plane", "PLANE",-0.06360427614293, 0.03868728323699, 0, False, 0, Nothing, 0)
Part.ClearSelection2 True
'create circle
Dim skSegment As Object
Set skSegment = Part.SketchManager.CreateCircle(0#, 0#, 0#,-0.023045, 0.019656, 0#)
Part.ClearSelection2 True
boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT",-0.01711713741461, 0.02558352601156, 0, False, 0, Nothing, 0)
Dim myDisplayDim As Object
Set myDisplayDim = Part.AddDimension2(-0.0211730622701,0.04336719653179, 0)
Part.ClearSelection2 True
'giving dimension
Dim myDimension As Object
Set myDimension = Part.Parameter("D1@Sketch2")
myDimension.SystemValue = 0.0413
Part.ClearSelection2 True
Part.SketchManager.InsertSketch True
End Sub
SolidworksApi macros