mcneel / rhino3dm

Libraries based on OpenNURBS with a RhinoCommon style
MIT License
610 stars 139 forks source link

Support layer indexes #354

Closed fraguada closed 3 years ago

fraguada commented 3 years ago

At the moment, there isn't a great way to get the index of a layer, which is useful for setting an object's layerIndex attribute. I'd expect to get the layerIndex after adding the layer to the File3dm.ObjectTable:

const layer = new rhino.Layer()
const layerIndex = doc.layers().add( layer )
const oa = new rhino.ObjectAttributes()
oa.layerIndex = layerIndex
const point = new rhino.Point( [0,0,0] )
doc.objects().add( point, oa )
mcneel-build commented 3 years ago

Linked with RH3DM-139