display layer menu in html?

This section is for general discussion about Gadgets
Post Reply
Posts: 23
Joined: Tue Nov 06, 2012 4:47 am
Model of CNC Machine: Legacy Maverick 4x8, BOSS laser
Location: Los Altos Hills, CA

display layer menu in html?

Post by Chelmite »

How do I display a menu with all the layers in the design?
I can get a list of the layers with the following, but how do I get that into the HTML?

Code: Select all

   local job = VectricJob()
   if not job.Exists then
  	 DisplayMessageBox("No job loaded")
   	return false;
   local active_layer = job.LayerManager:GetActiveLayer()
   local layer
   local layers={}

   local pos = layer_manager:GetHeadPosition()
   while pos ~= nil do
   	layer, pos = layer_manager:GetNext(pos)
   	layers[#layers+1] = layer
   	printf("%s", layer.Name)

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

Re: display layer menu in html?

Post by Adrian »

Depends how you want to display it. It's all HTML rather than Lua. You could build and HTML table, create a dropdown or a large list/edit box. Look up how you would do it for a web site and just build the same code in a Lua variable and display it with the HTML commands in the SDK.

Post Reply