Please find the macro,Insert the existing macro at the mentioned place.
The program worked. I thought the program will work on each part file(Open Sheet metal part file and run the macro). But the program is working on assembly(more than i expected). Now I just need one thing that you said earlier and I misunderstood is that it should check if the part is sheetmetal, else traverse to next.
I tested it, It don't work when
1). When a part is suppressed
2). When a part contain Subassemblies
1.When it is suppressed we would get null object (blank) ,So if u want to consider or leave it as it is ?
2.We are considering all the parts of the assembly , even which are under a sub-assembly category,so that will not be a problem.All the parts can be dragged to our macro object.
I added following codes
s = vcomp(i).IsSuppressed
If s = True Then
i = i + 1
Set swcomp = vcomp(i)
its working, this is inserted just after for loop starting, Now i want the program to check weather the part is sheetmetal or not. Isearched for issheetmetal method(ibody2) but could not understand.
You can use the GetBendState method.
I already read your response in a different thread, i searched a lot on this, but not able to use this due to lack of experience. I searched on SolidWorks help too, but there is no example. So if you can please elaborate, i can use the macro in my upcoming project, else i have to save each part manually.
add this line
If swmodel.GetBendState <> swSMBendStateNone then
after this line
Set swmodel = swcomp.GetModelDoc2
I've not tested it but it should work.
Deepak You are a genius
Loads of thanks.
can you try this macro please, on assembly having subassemblies and some component suppressed?
Please find the attached macro.Let me know if there is any modification.
I am done with this code. I have added few things in the code attached here. One thing is- the 'escape key' to end code in mid, which sometimes works and sometimes not(I think the location of code is not appropriate).
Please tell me if the code is okay and ready to use.
Forums are great way to get solution of any problem. I am very grateful to forum members. I have made my program. Attaching here so that others can use it. The program may have some shortcomings, but it runs and do the work.
Retrieving data ...