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?
programming: error message
-
- 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
The job:ImportDxfDwg returns a true or false value, not the object itself.
Paul Rowntree
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com
Re: programming: error message
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.
Thanks for the help.
-
- 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
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.
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
WarpDriver, StandingWave, Topo and gadgets available at PaulRowntree.weebly.com