1
$\begingroup$

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.

https://drive.google.com/drive/folders/19SiwRlHFebL4Ma_cUFh2RAG2NP9lk_y8?usp=sharing

$\endgroup$
2
  • $\begingroup$ SolidWorks Macro Record will capture steps you complete manually. Then you can manually make changes. $\endgroup$ 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$ Oct 25, 2021 at 19:38

1 Answer 1

0
$\begingroup$

This line works OK for me

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

$\endgroup$

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.