Hi,
I require assistance with the attached macro. The form gives the user an option to chose if he wants to cut the left or right side of the part.The form works fine if the line
( 'If strOpt = "No" Then) is commented out.However if you remove the ' and add another end if at the bottom then the macro does not work.
Thank you
SolidworksApi macros
You have defined strOpt two times (in module1 and in UserForm), so strOpt in Main is allways empty.
Ivana,
The attached macro does not seem to work. The only problem I could see is that it was created in 2013 while I am using SolidWorks2012.
I have fixed the references to point to SolidWorks 2012 and it still does not work.
Thank you
Help please
Hi Feroz.
The macro works! The only thing you must note is that there ia s plane with the name -Right- in your model.
Manfred,
After rechecking, I found that the macro works only if the plane is pre-selected. The idea behind the macro was to only split the part about the right plane.
Feroz,
i have changed the macro to check if the plane is in the model and selectable. Otherwise you will see a message.
Manfred,
Thanks for your assistance. I require the macro to work without having to select the plane as it should cut about the right plane by default.
Feroz,
and so the macro works!! If there is a plane with the name RIGHT you must not select it!!! Please check the spelling of your plane name (Lower/Uppercase).
Manfred,
Sorry for being a nuisance. The macro is not working on my side. Please see attached video.
Please change the line
Boolstatus = swModel.Extension.SelectByID2("Right", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
in
Boolstatus = swModel.Extension.SelectByID2("Right Plane", "PLANE", 0, 0, 0, True, 0, Nothing, 0)
in the macro. The name of the entity you want to select in the Sw API must have the SAME name as in Fetauremanager design tree.
Hi Feroz,
In the macro instead of
If Boolstatus = True Then
just use
If Boolstatus Then
"If Boolstatus = True" is evaluating to false so the macro is not working
Santosh,
Thank you.This has solved the problem.
Thank you also to Ivana and Manfred for the assistance.
Thanks Santosh for finding the issue, I've been messing with this macro but could not find out as why it is not working.
Thanks for sharing, learned something new
Thank you also to Deepak who was trying to assist outside this forum.