Basically I have nearly 1000 files. I want to edit a dimension which is labeled D2@Sketch 10. Assuming that the name can be a variable, I want to do this task:

D2@Sketch 10 = D2@Sketch 10 + 0.005

So basically I want to take the value of the dimension, add 5mm to it and then assign it to itself. To put simply, add 5mm in an already existing value of dimension.

I am sure that there is no other way I can achieve my goal in batch processing these files.

I have very little experience with Macros. I am attaching the part file and the macro I have used previously to assign specific values to dimensions.


  • $\begingroup$ SolidWorks Macro Record will capture steps you complete manually. Then you can manually make changes. $\endgroup$ Commented Oct 22, 2021 at 1:31
  • $\begingroup$ But I am not able to add the logic of adding just 5mm to a dimension. It gets passed as the value that I give in the recording session. By someway, I should be able to call the previous dimension value and then add 5mm to it. $\endgroup$ Commented Oct 25, 2021 at 19:38

1 Answer 1


This line works OK for me

Part.Parameter("D1@Sketch10").SystemValue = Part.Parameter("D1@Sketch10").SystemValue + 0.005


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.