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?
Solved! Go to Solution.
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
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.
Production: NX10.0.3, VERICUT 8.1, FBM, MRL 3.1.7 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk Testing: NX12.0 Preparing: NX12.0
Employees of the customers, together we are strong
How to Get the Most from Your Signature in the Community
NX Customization - Best Practice Guide