Creating a circle with a gadget

This section is for general discussion about Gadgets

Creating a circle with a gadget

Postby GrainDesign » Tue Dec 05, 2017 8:49 am

Hi there

I'm just learning how to create gadgets and was wondering what the easiest way of creating a circle within a gadget is.

I have tried to use the CreateCircle() global method but cant seem to get it to work it just keeps returning a nil value. (Maybe I'm doing something wrong)

Would it be easier to us the contour:ArcTo() method and us either 2 or 4 lines arced to make the circle.

any help would be appreciated.

Vectric Apprentice
Posts: 4
Joined: Thu Jun 16, 2016 8:05 am
Model of CNC Machine: Ascent pro

Re: Creating a circle with a gadget

Postby Adrian » Tue Dec 05, 2017 10:13 am

This is a bit of code based on an example SDK script that draws a circle using CreateCircle.

Code: Select all

require "strict"

function AddGroupToJob(job, group, layer_name)

   local cad_object = CreateCadGroup(group);
   local layer = job.LayerManager:GetLayerWithName(layer_name)
   layer:AddObject(cad_object, true)
   return cad_object

function main()

    local job = VectricJob()
    if not job.Exists then
       DisplayMessageBox("No job loaded")
       return false; 

   local group = ContourGroup(true)
   AddGroupToJob(job, group, "Circle Example")       

   return true

User avatar
Vectric Archimage
Posts: 7906
Joined: Thu Nov 23, 2006 2:19 pm
Location: Surrey, UK
Model of CNC Machine: ShopBot PRS Alpha 96x48

Return to Gadgets - General

Who is online

Users browsing this forum: No registered users and 1 guest