Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations 3DDave on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Removing selection stickness from cam operation

Status
Not open for further replies.

SSmmiill

Mechanical
Apr 9, 2017
1
Hello! Writing a short journal that would save screenshots for each tool movement in CAM operation. My main problem is that I don't know how to remove selection sickness from "NXOpen.CAM.CAMObject". here is the code below. Wanted this to work for any process, not just cavity milling as below. Thanks in advance.


Code:
Option Strict Off
Imports System
Imports System.Drawing
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main (ByVal args() As String) 

Dim theSession As NXOpen.Session = NXOpen.Session.GetSession()
Dim workPart As NXOpen.Part = theSession.Parts.Work
Dim displayPart As NXOpen.Part = theSession.Parts.Display


Dim kinematicConfigurator1 As NXOpen.SIM.KinematicConfigurator
kinematicConfigurator1 = workPart.KinematicConfigurator

Dim objects1(0) As NXOpen.CAM.CAMObject
Dim cavityMilling1 As NXOpen.CAM.CavityMilling = CType(workPart.CAMSetup.CAMOperationCollection.FindObject("CORNER_ROUGH"), NXOpen.CAM.CavityMilling)

objects1(0) = nCGroup1
Dim isvControlPanelBuilder1 As NXOpen.SIM.IsvControlPanelBuilder
isvControlPanelBuilder1 = kinematicConfigurator1.CreateIsvControlPanelBuilder(NXOpen.SIM.IsvControlPanelBuilder.VisualizationType.ToolPathSimulation, objects1)
isvControlPanelBuilder1.SetSingleStep(NXOpen.SIM.IsvControlPanelBuilder.SingleStepType.Block)
isvControlPanelBuilder1.SetSpeed(10)


Dim simulationOptionsBuilder1 As NXOpen.CAM.SimulationOptionsBuilder
simulationOptionsBuilder1 = isvControlPanelBuilder1.SimulationOptionsBuilder

Dim response1 As Integer
response1 = isvControlPanelBuilder1.SetShow3dMaterialRemoval(True)

isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0001.png")
isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0002.png")
isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0003.png")
isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0004.png")
isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0005.png")
isvControlPanelBuilder1.SingleStepForward()
        ExportScreenshot("C:\Users\capproj\Desktop\testfolder\NX_screenshot0006.png")
isvControlPanelBuilder1.SingleStepForward()
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor