Hide Sketch Dimension Input in a VBA Macro

Hello, I have recorded a macro that adds dimensions to a sketch. When I play it again, the dialogs for creating dimensions to be validated appear for the user. I would like the values to be validated by default without action after the macro is launched. Is there a vba command of the type Application.DisplayAlerts = False for the SolidWorks VBA?
Thank you.

What do you use, AddDimension2?

You need to share your code so we can help you

3 Likes

Oui, ci-dessous la partie du code concernée :

Dim myDisplayDim As Object
Set myDisplayDim = Part.AddDimension2(8.08569278749249E-02, 0.176508507199797, 0.002)

Dim myDimension As Object
Set myDimension = Part.Parameter(« D1@Esquisse2 »)
myDimension.SystemValue = 0.2

Merci

Beware of macros recorded in solidworks, it's very often.
I would like to @Konti for a code sharing to better define your need as a result of your code. For me, there is no useful dialog box if the addition of dimensions is done by macro.
Otherwise to disable rebuilds or other see in 5.5 5.6... To disable the tree, graphics area, or other methods:

2 Likes

I think it's a problem of settings and that you have to disable the " enter the odds " option

image

2 Likes

Hello, thank you very much. I just tested it and it works. In addition, you can add this parameter in the code to activate it.

1 Like