Finding The Body Bounding Cylinder Using VBA

Use this space to ask how to do whatever you're trying to use SolidWorks to do.
senuba
Posts: 11
Joined: Thu Oct 26, 2023 1:37 am
Answers: 0
x 13
x 1

Finding The Body Bounding Cylinder Using VBA

Unread post by senuba »

I have a cylindrical part. I need to find the measurements surrounding it. I will create an order measurement by adding a 5mm margin. When I run the macro on a square prism or cylindrical part, it will give the widest measurement that encompasses the part. I found something similar on a website, but it wasn't in VBA. How can I do this with VBA?
https://www.codestack.net/solidworks-ap ... -cylinder/

I can handle prism shapes. For instance, it finds the measurements 47 x 12 x 480 and gives me an order measurement of 50 x 15 x 485 mm. How can I create an order measurement for parts that will be ordered as shafts? (I don't want it to draw. Just Debug.Print is enough.)
Post Reply