Getting component names from SolidWorks assembly

Hi all,

Im trying to get by code the names of an assembly components. the assembly is a routed harness, made by using the "from-to" function, so now I created

the harness, its well routed and all components are liste under 'components' directory in the tree.

problem is, when i try to get to these components by code, i can only see part of their name or 'path' in solidworks design tree.

for example,

connector in the harness with name P6, will be shown in tree as the following.\

[sldpart name]<(shell... (???)Display State) {P6}

the last part of this string between the {} brackets, is what im trying to fetch, but i cant do it.

already tried by:

comp.Name2()

comp.getSelectByIdString()

with no success.,

any help?

thanks

Noam

SolidworksApi macros