cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

List all components from assembly using API

Manjunath
12-Amethyst

List all components from assembly using API

i all,

 

I would like to list out all the parts in assembly (including parts from sub assemblies) using VB API.I face problem in the following line

 

compath = (New CMpfcAssembly).CreateComponentPath(assembly, currentlevel) 
currentComponent = compath.Leaf

 

when I use this code I could not get the path of current component, it always refers to toplevel assembly.

Throw some light on this

 

1 REPLY 1
RPN
17-Peridot
17-Peridot
(To:Manjunath)

In my point of view you don't need a component path. Visit the assembly by components, if you found an assembly, call the function recursively. An couple of arrays by level including the count would help later, and for each component found, and as well a tag for already visited assemblies. As a result you may have all path information for each component feature 🙂

Announcements


Top Tags