Modifying MEP Dimension Tolerances to VBA

Hello

I'm far from being an expert in VBA, and yet I'm looking for a way to modify tolerances according to a conditional formula in VBA. For the moment I can just select a dimension and modify its tolerance, but I get stuck because I can't get the value of this controlled dimension for the conditional formula from which the choice of tolerance results.

I already have this:

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.ActivateView("Drawing View12")
boolstatus = Part.Extension.SelectByID2("RD1@Drawing View12", "DIMENSION", 0.133426296089701, 0.207466790382401, 0, False, 0, Nothing, 0)
boolstatus = Part.EditDimensionProperties2(4, 0.0001, 0, "", "", True, 9, 1, True, 12, 12, "", "", True, "", "", True)
Part.ClearSelection2 True
End Sub
 

Does anyone have a proposal?

Thanks in advance

Hello

See if there is what you are interested in in the attached macro, it allows you to list the dimensions and a certain amount of information about them, to add a low text on each dimension and then to display the result in Excel.

Kind regards


anotation_plan_solidworks.swp

Hello d.roger,

thank you for your feedback, but not having enough experience in VBA, I wouldn't want to tinker with a code without understanding it. So I'm going to proceed in another way, I'm just thinking of inserting the table of the part family with the different dimensions and tolerances to be filled in.

Sorry for wasting your time, but I'd rather learn how to use VBA properly before making mistakes.

Thank you again, have a good day.