SolidWorks Geeks

Mario Matekalo

Problems with IF statement, chamfer and fillet macro

Hi, guys!

I have a huge problems with IF statement logics, chamfer and fillet macro. Although I'm using SW for 3-4 years I'm still a beginner when it comes to SW API.

 I'm trying to create a hole on my shaft for the key. If you take a look to the code I wrote for the retaining rings on the same shaft, you will see the same IF statement logic used for creation of the hole. But when I use the (necessary) diameter of 40 mm for the lenght 4 (see pic.2) the program is not using the data for 40 mm diameter. It takes the data for 25-30 mm diameter and I cant find out why. To create a macro mostly I use a recording possibility as you will (i hope) see in my macro.

I also need to create a chamfer and (face) fillets.  When I created a macro for chamfer and face fillets it worked just fine for the dimensions showed in picture 2 but when I change the lenghts (L2, L3, L4) or diameters (R2, R3, R4) the macro won't work. Does anybody know any code for chamfer and fillets that is independeable of lenghts and diameters? Codes for chamfer and face fillets aren't part of the attached macro. I deleted them.

I'm making this shaft for one of my colledge projects and any help is urgent and it will be most appreciated. 

Views: 60

Attachments:

Reply to This

Replies to This Discussion

Sorry, the macro was missing. So here it is...

Attachments:

Reply to Discussion

RSS

Connect to other SolidWorks Geeks throughout the world.... Share tips, tricks and ideas...Learn to master SolidWorks.

Birthdays

© 2012   Created by Alex R. Ruiz.   Powered by .

Badges  |  Report an Issue  |  Terms of Service