programming: error message

This section is for general discussion about Gadgets
Post Reply
tjskcnc
Posts: 16
Joined: Tue Apr 19, 2011 3:49 pm
Model of CNC Machine: diy

programming: error message

Post by tjskcnc »

code:
function main(_path)
job = VectricJob()
layer = job.LayerManager:GetActiveLayer()
layer:AddObject(job:ImportDxfDwg(_path .. "\\Folder\\sample.dxf"), true)
job:Refresh2DView()
return true
end

error mssg:
Script: Compiled Script
Line: Unknown
(method AddObject)
No matching overload found, candidates:
bool AddObject(CadLayer&,CadObject*,bool)

Any ideas?

PaulRowntree
Vectric Wizard
Posts: 1687
Joined: Sun Oct 24, 2010 7:28 pm
Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
Location: Guelph, Ontario
Contact:

Re: programming: error message

Post by PaulRowntree »

The job:ImportDxfDwg returns a true or false value, not the object itself.
Attachments
importdxfdwg.png
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com

tjskcnc
Posts: 16
Joined: Tue Apr 19, 2011 3:49 pm
Model of CNC Machine: diy

Re: programming: error message

Post by tjskcnc »

:oops: the dxf file does import into the current VCarve job but then displays the error mssg. Do I need to sign the dxf file to a CadContourObject, or is there another method of importing vector files?
Thanks for the help.

PaulRowntree
Vectric Wizard
Posts: 1687
Joined: Sun Oct 24, 2010 7:28 pm
Model of CNC Machine: homebuilt 4'x2' (Mach3+G540)
Location: Guelph, Ontario
Contact:

Re: programming: error message

Post by PaulRowntree »

Yes, the import works, and the object is added to the job. But you are then passing the resulting true/false value to the AddObject routine, but it expects an object reference and so it throws an error.

I don't work with dxf's but I think you must get the selected vectors (?) after the import, and work with them.
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com

Post Reply