AnsweredAssumed Answered

How to Add Dimension to sketch without the user prompt

Question asked by Jared Ticotin on Jun 17, 2020
Latest reply on Jun 17, 2020 by Jared Ticotin

I have this simple code that was generated from record macro:


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
boolstatus = Part.Extension.SelectByID2("Arc1", "SKETCHSEGMENT", 3.7150296065182E-03, 2.27937040626695E-02, 0.271824680271828, False, 0, Nothing, 0)
Dim myDisplayDim As Object
Set myDisplayDim = Part.AddDimension2(2.92954224961134E-02, -9.04798883599746E-03, 0.338308576024644)
Part.ClearSelection2 True
Dim myDimension As Object
Set myDimension = Part.Parameter("D1@Sketch3")
myDimension.SystemValue = 0.00635
End Sub

When I run this, I get a popup which requires the user to click "ok" to close, then it sets it's value. How can I add a dimension to a circle in a sketch without this popup? Or at least in a way that doesn't require the user to do anything?