API access to NCPrograms

API access to NCPrograms

dames123
Advocate Advocate
70 Views
4 Replies
Message 1 of 5

API access to NCPrograms

dames123
Advocate
Advocate

Is there a way to insure this toggle is off using the API?

 

dames123_0-1759426035178.png

Thanks.

0 Likes
Accepted solutions (1)
71 Views
4 Replies
Replies (4)
Message 2 of 5

boopathi.sivakumar
Autodesk
Autodesk

Hi @dames123 

You can do like this 

ncProgram.parameters.itemByName('nc_program_orderByTool').value.value = False

 


Boopathi Sivakumar
Senior Technology Consultant

Message 3 of 5

dames123
Advocate
Advocate

Thank you @boopathi.sivakumar .

 

What's the difference between ncParameters and ncProgram.parameters? I can't find it in the help file. My script uses ncParameters.

 

 

example:

for setup in setups:
            ncIpt: adsk.cam.NCProgramInput = ncPrograms.createInput()
            ncIpt.displayName = setup.name
            ncParameters = ncIpt.parameters
            # Set the filename to the same as the setup parameter
            ncParameters.itemByName('nc_program_filename').value.value = setup.parameters.itemByName('job_programName').value.value
            ncParameters.itemByName('nc_program_openInEditor').value.value = False
            ncParameters.itemByName('nc_program_useMachineConfig').value.value = True
            ncParameters.itemByName('nc_program_comment').value.value = setup.parameters.itemByName('job_programComment').value.value
            #ncProgram.parameters.itemByName('nc_program_orderByTool').value.value = False
0 Likes
Message 4 of 5

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

Ah! my case the variable name was ncProgram but in your case it should be like 

ncParameters.itemByName('nc_program_orderByTool').value.value = False


Boopathi Sivakumar
Senior Technology Consultant

0 Likes
Message 5 of 5

dames123
Advocate
Advocate

I tried that and it didn't seem to work at first but I figured it out.

 

Thanks @boopathi.sivakumar 

0 Likes