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 )
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: