I have a macro that allows me to run multiple commands on Solidworks from an Excel file.
I want to develop this macro by doing a "Composition to go" of an assembly that the macro opens before.
However, I would like to exclude some pieces from the takeaway composition based on their name (those that are in a standard element library) but I can't find the corresponding code.
Here is the link to the code used for the takeaway composition: http://help.solidworks.com/2012/English/api/sldworksapi/Pack_and_Go_an_Assembly_Example_vb.htm
Do you know how to exclude parts from a line of code?
It is in this part that the exclusion should be made:
Dim swModel As SldWorks.ModelDoc2
Dim swPackAndGo As SldWorks.PackAndGo
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel.GetPathName() <> "*Bride*" Then
In this link: https://cloud.centralinnovation.com.au/sharpcode/index?article=Exclude-files-from-Pack-n-Go
But I don't think I'm using it in the right way because, as I understand it, the excluded components are the ones that contain in their name part of the assembly name. However, I would like to exclude components that contain specific text.
I'm still working on the code to exclude a second string before integrating it into the Solidworks API code to be able to choose the destination folder of the composition to take away.