I can create the new layer using the CADLayerManager:GetLayerWithName(string layer_name) method but the new layer is always created at the end of the list.
I can see that there is a CADLayerManager:AddLayer(CadLayer layer, int index) method but that takes a pre-existing method as an argument.
I have tried to create a reference to my new layer, removing the layer from CadLayerManager using the :RemoveLayer(CadLayer layer) method and then adding the layer back to the CadLayerManager using the :AddLayer(CadLayer layer, int index) method but that gives me the error:
(global createNewLayer)
AddLayer: std::runtime_erro: 'luabind: smart pointer does not allow ownership transfer'
Here is the code that I thought might work...
Code: Select all
local newLayer = g_job.LayerManager:GetLayerWithName(newLayerName)
g_job.LayerManager:RemoveLayer(newLayer)
g_job.LayerManager:AddLayer(newLayer, originalLayerIndex + 1)
I'm assuming I'm either overthinking this or I am misinterpreting the Vectric Interface documentation. Can someone show me how to do this?
Thanks,
Rob
ps: a CADLayerManager:Move(up or down) method would sure be nice in this situation