Get components2

Hello @tous
Do you have an idea to make this Macro work
For a first level bill of materials only I didn't manage to get it to work :thinking:

1 Like

Mmm, it seems that I missed this clarification


On the other hand, the definition of the function in question indicates that it is functional on a first level (without excluding the saus together), do you have any idea

Hello

Tested on a single file with a bill of materials set to "first level only" and then "parts only", no problems with the operation of the macro.
tested on SW2022 SP5

Hello @Cyril.f
Does your nomenclature have a saus assembly?

Tested again on the 22sp4, still nothing!

No, I double-check with that.

Same, no problem.

It's strange, no matter how hard I try but it doesn't cross the underlined conditions, GetComponents2 returns an empty array!


Getcomponentcount2, returns many elements, but not the GetComponents2 function!

It returns elements but Component count = 0 means that for it there is no component attached to the nomenclature line.
Loose Questions:

  • Is the file real (not a virtual file in an asm)?

  • Is the whole file (drw + content) saved (not temporary files to test how the macro works)

After maybe a bug of the SP4 but I doubt.

1 Like

I started over with a new file and it works😯
So I tried to take the base file, deleted everything, and undo the removal of components one by one, tested for each scenario and it works even when going back to the initial state, I didn't find what is blocking, but it works thanks to you @Cyril.f, thank you,