API drawing - find the "Welded parts list name"

Hello

As a novice in Solidworks API programming (but not in programming at all), I've been tearing my hair out for several days without finding a solution:

since a drawing, I want to retrieve in a variable the "name of the welded parts list" (SW-CutListItemName, i.e. the name used in BOMs/parts lists, for multi-body parts).

In the drawing I know that you can associate a bubble with this value to a part in a view, so logically in programming it is possible to find this value? (for bubbles, it only works if a "parts list" is associated with the view in question).

We must also be able to open the part present in the view to find this value?

I really don't know in which direction and how to dig, any of you have an idea?

environment:

SolidWorks 2021 Standard, PDM Pro

thank you in advance

F.MAT

Well, the classic move:

after days of struggling, doing research in all directions, and just after asking the question on this forum... I did yet another search, and I found the information I was looking for here:

https://www.codestack.net/solidworks-tools/

In the lot, there is a macro that renames the views of a drawing by the "name of the welded parts list".

So I just have to analyze it to understand how we get this information:)

If it can help someone....

Thank you

F.MAT

1 Like

Hello

If you haven't found what you wanted, don't hesitate to contact me, I'll give you a hand.
Two main possibilities depending on what you want to do:


-- Use the welded parts bill of materials to retrieve all the information at once, then process it in programming without necessarily using the API (example: a macro that makes an export of the list of welded parts and analyzes this export in an excel macro). It's often a bit dirty, but it allows you to quickly arrive at a result that can be used in a very specific situation.


-- Browse the properties of the welded parts of a single part and/or recursively browse the components of an assembly in order to directly retrieve the properties of each welded part, but this requires a little more mastery of the PLC.


Codestack is a great site made by Xarial who has done a great job in recent years. You will certainly find other good tips there.
The official API help is also very well done and comprehensive and if you are a seasoned programmer, as soon as you get used to using SW-API, the official help should be enough for you.

Don't hesitate to explain what you want to achieve as a result, there may be a "classic" way to do it.
A+
Rafael

1 Like

Hello

 

Thank you for your answer.

 

It's okay I managed to get by with the help of Xarial's macros, indeed his site is full of interesting things.

 

I'm not a seasoned programmer, but I still manage to understand quite well how a code works (when it is commented ^^ ), so between the official help and the examples seen here and there, I struggle a little but I still manage to move forward.

 

Now I'm going to tackle the PDM and Document Manager APIs, I feel that it's going to be a little more complicated:D

 

Thank you for your proposal, I'll come back to the forum for the next problems! :)

@+

F.MAT

1 Like