-- a page of 100 mm by 60 mm with a line, a circle and a text pl = Graphics.New({{"Canvas.Size.X",100}, {"Canvas.Size.Y",60}}) pl.Add({ {0.1,0.1}, {0.9,0.1} }, {{"Color",0x0000FF}}) pl.Add({"Arc", {0.5,0.5}, 0.2}, {{"Line Width",0.01}}) pl.Add("Quanty", 0.5, 0.45, {{"Alignment","c"}}) T = Graphics.ToTable(pl) -- the page and the elements print("CanvasSize ", T.CanvasSize[1], T.CanvasSize[2]) print("CanvasOrigin", T.CanvasOrigin[1], T.CanvasOrigin[2]) for _, Kind in ipairs({"Line", "Curve", "Arc", "Text", "BitMap", "Layer"}) do print(string.format("%-6s %d", Kind, T[Kind] and #T[Kind] or 0)) end -- the fields of the line, sorted by name Names = {} for Name in pairs(T.Line[1]) do Names[#Names+1] = Name end table.sort(Names) for _, Name in ipairs(Names) do local v = T.Line[1][Name] if Name == "Point" then print(Name, "{ {"..v[1][1]..", "..v[1][2].."}, {"..v[2][1]..", "..v[2][2].."} }") elseif Name == "Color" or Name == "FillColor" then print(Name, string.format("0x%08X", v)) else print(Name, v) end end -- change the table and make a new Graphics object of it: the circle red and twice as large T.Arc[1].Color = 0xFF0000 T.Arc[1].R = 2*T.Arc[1].R pl2 = Graphics.New(T) print("radius", Graphics.ToTable(pl).Arc[1].R, Graphics.ToTable(pl2).Arc[1].R)