Hi Raul, I've only just started getting into macros, so my knowledge is minimal. But I would have go at linking your dimensions to global variables, the you can change all dims with the same method. https://forum.solidworks.com/message/704466#comment-704466
I assume this is part of a bigger plan? This could be done via a design table with far less hassle.
After your answer i close the macro as I sended, to try to manage the first 2 dims
The third dimension (Depth) I'm still trying.
Because I use the (Base Flange/Tab) command.
But some examples that I found, they select the feature by click, and I want to select it by Name because i already know it.
Could you help me?
ok is already selected.
Now to modify the D1OffsetDistance?
lets try with below lines.
Dim swApp As SldWorks.SldWorks
Dim swmodel As SldWorks.ModelDoc2
Dim swselmgr As SldWorks.SelectionMgr
Dim Swfeat As SldWorks.Feature
Dim boolstatus As Boolean
Dim swBaseFlange As SldWorks.BaseFlangeFeatureData
Set swApp = Application.SldWorks
Set swmodel = swApp.ActiveDoc
Set swselmgr = swmodel.SelectionManager
boolstatus = swmodel.Extension.SelectByID2("Base-Flange1", "BODYFEATURE", 0, 0, 0, False, 0, Nothing, 0) 'change the selection
Set Swfeat = swselmgr.GetSelectedObject6(1, -1)
Set swBaseFlange = Swfeat.GetDefinition
swBaseFlange.AccessSelections swmodel, Nothing
swBaseFlange.D1OffsetType = 1
swBaseFlange.D1OffsetDistance = 10 / 1000
Swfeat.ModifyDefinition swBaseFlange, swmodel, Nothing