Reply

how to access specific part in assembly

[ Edited ]

Hi,

I am learning Solid Edge API's and facing one problem.

In assembly there are 3 parts 1)Base 2)Frame3)Rod

 

now I want to access either Base or Rod using file name.

is there any method in assembly to access part by name.

 

Thanks in advance.

 

 

Posted by: pawan aher
Post date: 12/18/2011 11:48:00 PM

3 REPLIES

RE: how to access specific part in assembly

[ Edited ]

In VB.net

objPart = objDoc.Occurrences.Item(1)

sFileName = objPart.Name

With objApp.ActiveDocument.Occurrences

For x = 1 To .Count - 1

If sFileName "Base .par:1" Then

objPart = objDoc.Occurrences.Item(x)

sFileName = objPart.Name

End If

Next

End With

 

Posted by: Nivaldo Coelho
Post date: 1/9/2012 7:08:18 AM

RE: how to access specific part in assembly

[ Edited ]

Thanks for the replay.

 

This way need to traverse whole assembly.

I am also doing same project in Solidworks.

In SWX there is GetComponentByName("Name of part") method.

I am looking for such method in Solidedge.

 

Posted by: pawan aher
Post date: 1/11/2012 8:56:19 PM

RE: how to access specific part in assembly

[ Edited ]

@pawan,

 

the Occurrences collection doesn't provide an indexer by name. But you could try to write such a function by using the RevisionManager.Application object which allows faster recursive traversing of large assembly structures and even works if the assembly is already opened by the SolidEdge.Application object.

 

Posted by: Wolfgang Kunert
Post date: 1/11/2012 9:58:45 PM