AnsweredAssumed Answered

Change dimension value with global variable name in VBA

Question asked by Taha Çetiner on Dec 14, 2018
Latest reply on Dec 15, 2018 by Taha Çetiner

Hi everyone,


I have dimension in sketch as D1@Sketch1 and this dimension value is 50. I want to change D1@Sketch1's Value as NewDiameter. NewDiameter is global variable name and NewDiameter 's value is 40. My code isnt working.


Sub main()


Dim swApp As Object

Set swApp = Application.SldWorks

Set swModel = swApp.ActiveDoc

Dim mydimension As Object

Set mydimension = swModel.Parameter("D1@Sketch1")

mydimension.SystemValue = "=""NewDiameter"""


End Sub