cancel
Showing results for 
Search instead for 
Did you mean: 

how to collect objects from Unused Items

Pioneer
Pioneer

Hi,

 

I tried to use the following to collect all objects from the program order view:

 Dim ncgroups As NCGroupCollection = workPart.CamSetup.CAMGroupCollection
 Dim ncgroupsArray As NCGroup() = ncgroups.ToArray()..but objects from the Unused Items was left out. How to collect all objects including those from Unused Items?

 

achuan

NX 9.0.2.5

NX 10.0.3.5, WINDOWS 7
3 REPLIES

Re: how to collect objects from Unused Items

By design, objects in unused items are ignored in CAM, so I think you need to explicity look in the NONE group.

I have a program moves objects to the unused group in all 4 views - perhaps how the "NONE" group is referenced here will help you:

 

    Function action(ByVal camObjectTag As Tag) As Boolean

        Dim camObject As NXObject = NXObjectManager.Get(camObjectTag)
        Dim WorkPart As Part = TheSession.Parts.Work

		
        'Check if the object is an Operation
        If TypeOf camObject Is CAM.Operation Then
            Dim operationType As Integer
            Dim operationSubtype As Integer

			Dim objectsToBeMoved1(0) As CAM.CAMObject
			objectsToBeMoved1(0) = camObject

			Dim nCGroup1 As CAM.NCGroup = CType(workPart.CAMSetup.CAMGroupCollection.FindObject("NONE"), CAM.NCGroup)

			workPart.CAMSetup.MoveObjects(CAM.CAMSetup.View.Geometry, objectsToBeMoved1, nCGroup1, CAM.CAMSetup.Paste.Inside)
			workPart.CAMSetup.MoveObjects(CAM.CAMSetup.View.ProgramOrder, objectsToBeMoved1, nCGroup1, CAM.CAMSetup.Paste.Inside)
			workPart.CAMSetup.MoveObjects(CAM.CAMSetup.View.MachineTool, objectsToBeMoved1, nCGroup1, CAM.CAMSetup.Paste.Inside)
			workPart.CAMSetup.MoveObjects(CAM.CAMSetup.View.MachineMethod, objectsToBeMoved1, nCGroup1, CAM.CAMSetup.Paste.Inside)
			
        End If
		

        Return True
    End Function

 

Mark Rief
Retired Siemens

Re: how to collect objects from Unused Items

Esteemed Contributor
Esteemed Contributor

FindObject with NONE will find any of the four unused groups, if you like to find a specific one depending on the view, you would need to use CAM.CAMSetup.GetRoot(), CAM.NCGroup.GetMembers() and check for the name NONE.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: how to collect objects from Unused Items

Pioneer
Pioneer
Got it.

Thanks

achuan
NX 9.0.2.5
NX 10.0.3.5, WINDOWS 7