The below code is part of a lager macro but I am trying to modify D1 in the "Extended" configuration only but the below code changes the dimension for all of the configurations.
How would I change it to this configuration only?
Dim ConfigMgr As ConfigurationManager
Dim Model As ModelDoc2
Dim C1a As Configuration
Dim SelMgr As SelectionMgr
Set Model = swApp.ActiveDoc
Set SelMgr = Model.SelectionManager
Set ConfigMgr = Model.ConfigurationManager
ConfigMgr.AddConfiguration "Extended", "", fileName1, 1, "", "no description"
ConfigMgr.AddConfiguration "Closed", "", fileName1, 1, "", "no description"
Model.ShowConfiguration2 ("Extended")
boolstatus = Part.Extension.SelectByID2("D1@Distance1@" & fileName1 & ".SLDASM", "DIMENSION", 0, 0, 0, True, 0, Nothing, 0)
Dim myDimension As Object
Set myDimension = Part.Parameter("D1@Distance1")
myDimension.SystemValue (strokeLength)
Part.ClearSelection2 True
You need to use SetSystemValue3 method, it has an option to specify configuration. Check this example for reference: SOLIDWORKS macro to create configuration with average dimension values