AnsweredAssumed Answered

If-else statement in solidworks macro not working

Question asked by Binish Mohan on Aug 11, 2020
Latest reply on Aug 11, 2020 by Binish Mohan

Hi everyone, I am planning auto add components to the assembly based on the surface area of the product. Like for example if the surface area is <1000mm^2, a new assembly will be created and a component called "side clamp" will be added, and so on. However, I realised that although the code will run, when I used a very big model, the code will still execute the if condition for the case of <1000 mm^2 and insert the side clamp to the new assembly, which by right should display message "Workpiece is too big for any clamp". From this I realised that there is something wrong with the if condition and its not executing the else-if condition. Do let me know of this issue. I have attached the macro code as well as the necessary parts needed for the code. Much appreciated

Outcomes