Reply

How to access first level of occurrences in assy?

[ Edited ]

 

Helo,

A'm programmer under NX6 in C# and C++. I want to get only first level of occurrences In SolidEdge ST2 assembly. Property SolidEdge.AssemblyDocument.Occurrences gives all levels of occurrences of all assembly.

Asm1.asm

     |---  Part1.par:1                          - first level

     |---  Part1.par:2                          - first level

     |---  SubAsm1.asm:1               - first level

     |           | --- Part2.par:1              - second level

     |           | --- Part3.par:1              - second level

    .

    .

    .

Thanks.

 

Posted by: Juraj Joob
Post date: 1/11/2010 2:16:13 AM

2 REPLIES

RE: How to access first level of occurrences in assy?

[ Edited ]

Juraj,

You are wrong. The collection Occurrences in an ASM file gives you only the first level of occurrences which is just what you want.

To get all the levels you should be calling a recursive subroutine.

Try this quick an dirty example in VB and see.

oSE=getobject(,"solidedge.application")

oAsm=oSE.ActiveDocument

for i=1 to oAsm.Occurrences.Count

debug.print oAsm.Occurrences(i).Name

next

 

Posted by: Julian Guillo
Post date: 1/11/2010 3:03:07 AM

RE: How to access first level of occurrences in assy?

[ Edited ]

Julian,

 

yes I was wrong.

 

Thanks.

 

Posted by: Juraj Joob
Post date: 1/11/2010 7:53:25 AM