Cycle by Tags on specific Component

Hello,

I'm creating an automatic assembly, I already tag the edges that will be use, but the cycle only work if the part with the tag is open separately. In the assembly file I can only cycle through half of them.

I notice that, since the component it's part of an array of components, the cycle of tagged edges run among every component in the array. I tagged the master component, but I don't know how to just look in that specific component.

Can someone help me on this?

Here is the code that I'm using to cycle between edges

Dim theSession As Session = Session.GetSession()
Dim lw As ListingWindow = theSession.ListingWindow
Dim theUI As UI = UI.GetUI()
Dim workPart As Part = theSession.Parts.Work
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim displayPart As Part = theSession.Parts.Display

Const nombreAgujero As String = "AGUJERO"
Dim counter As Integer = 22
Dim counter2 As Integer = 38
Dim EdgeTag As NXOpen.Tag = NXOpen.Tag.Null
Dim theEdge As Edge

For i As Integer = counter To counter2

theUfSession.Obj.CycleByName(nombreAgujero & counter.ToString, EdgeTag)
theEdge = NXObjectManager.Get(EdgeTag)
lw.Open()
lw.WriteLine(theEdge.Name.ToString)
'theEdge.Highlight()
counter += 1

Next

THANK YOU

Here is the code again. Sorry for the inconvenience of the original post.

Dim theSession As Session = Session.GetSession()
Dim lw As ListingWindow = theSession.ListingWindow
Dim theUI As UI = UI.GetUI()
Dim workPart As Part = theSession.Parts.Work
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim displayPart As Part = theSession.Parts.Display
Const nombreAgujero As String = "AGUJERO"
Dim counter As Integer = 22
Dim counter2 As Integer = 38
Dim EdgeTag As NXOpen.Tag = NXOpen.Tag.Null
Dim theEdge As Edge

For i As Integer = counter To counter2
theUfSession.Obj.CycleByName(nombreAgujero & counter.ToString, EdgeTag)
theEdge = NXObjectManager.Get(EdgeTag)
lw.Open()
lw.WriteLine(theEdge.Name.ToString)
'theEdge.Highlight()
counter += 1
Next

Automative

Instead of CycleByName, use CycleObjsInPart(tag,UFConstant Value,ref ugCylceTag)

Regards,
Pradeep Kumar Arunachalam

Regards,
Pradeep Kumar Arunachalam

You have kept Tag as a null..