Hello, I am new to API and learning API through SolidWorks API help.
I realized if I select a sketch segment and use smart dimension to add a dimension to it, this is the code generated by the macro recorder:
boolstatus = swModel.Extension.SelectByID2("Line1", "SKETCHSEGMENT", 6.37058785000819E-02, 0, -1.0016647562906E-03, False, 0, Nothing, 0)
Dim myDisplayDim As Object
Set myDisplayDim = swModel.AddDimension2(5.96992194749195E-02, 0, -1.94322962720376E-02)
swModel.ClearSelection2 True
Dim myDimension As Object
Set myDimension = swModel.Parameter("D1@Sketch1")
myDimension.SystemValue = 0.1
However, when I play the macro, the process is automatic except for the "unnecessary prompt of the Smart Dimension Dialog box". Whatever the value I put in the dialog box, finally I am getting the required dimension i.e., 0.1. But, how should I avoid the prompt of the Smart Dimension Dialog box?? Is there any code I need to add so that the dialog box automatically fills the assigned value in its text field?
Thank you very much.
Regards
Siva
SolidworksApi macros
You can call this line to suppress the dialog.
Please note that it is good practice to restore this value back after you finish.
____________________________________________________
Regards,
Artem Taturevych, Application Engineer at Intercad (Australia)
translationXpert – add-in to translate SolidWorks models
myIntercad – an integrated tool for SolidWorks Professionals
LinkedIn SolidWorks API Education Group
thank you very much!