utParameterList - VCarvePro

This section is for general discussion about Gadgets
Post Reply
Raedle
Posts: 3
Joined: Sun Mar 11, 2018 5:33 pm
Model of CNC Machine: Mach3 home-built high precision CNC

utParameterList - VCarvePro

Post by Raedle »

I'm trying to use the object utParameterList for a Job with out any success. I can set parameters but not get them. How do I add the parameter list object to the job? Please help. Thank you.

Code: Select all

function JobParameters(myJob)
  local dblValue
  local myParameterList

  --return utParameterList object
  myParameterList=myJob.JobParameters
  --Set a parameter 
  myParameterList:SetDouble("TESTME",9.99)

  --try to get parameter -> this does not work! What is wrong with the call
  dblValue=myParameterList:GetDouble("TESTME",1.11,true)
  
  return
end

Raedle
Posts: 3
Joined: Sun Mar 11, 2018 5:33 pm
Model of CNC Machine: Mach3 home-built high precision CNC

Re: utParameterList - VCarvePro

Post by Raedle »

Below is code where :GetDouble() method works. No idea why a ; is needed at the end of :GetDouble() and third parameter (bool create_if_not_exist) must be omitted.

Code: Select all

function JobParameters(myJob)
  local dblValue
  local myParameterList

  --return utParameterList object
  myParameterList=myJob.JobParameters
  --Set parameter 
  myParameterList:SetDouble("TESTME",9.99)

  --Get parameter 
  dblValue=myParameterList:GetDouble("TESTME",0.0);   --<----
  MessageBox("Value" ..dblValue)
  return
end

Post Reply