Not in rhinoscriptsyntax, no. Here is the documentation for rhinoscriptsyntax.AddLayer(), as you can see there is no option to set the print width etc. You can change these attributes later using rhinoscriptsyntax.LayerPrintWidth for example.
Why do you need this to be in one function call?
In RhinoCommon you’d be able to change the properties of the layer being created before adding it to the document, but that will take multiple calls. Have a look at the rhinoscriptsyntax.AddLayer source code to get started with that.
I’m back on this, and been having issues.
Could u suggest how to then change the newly added layers with only names including “crv” and “bbx” have a LayerPrintWidth of -1 (nonplot)?
That would mean the kayers would be named “crv_newElement”, etc
What have you tried so far, what is the error you are seeing? rhinoscriptsyntax.LayerPrintWidth(layer, width=None) and Rhino.RhinoDocObjets.Layer.PlotWeight (get/set property) are the two ways you can change a layer’s plot weight, depending on if you are looking to use rhinoscriptsyntax or RhinoCommon.
I’m using rs.
It’s the verbiage/order of ops for choosing the layer(s) I’ve just created earlier in the script, whose name(s) contain “crv” or “bbox” so I can change their PrintWidths to nonPlot (-1)
rs.AddLayer returns the full name of the layer, and rs.LayerPrintWidth expects a full name for a layer as its first argument. You can save that name to a variable when creating a new layer, and then modify that layer’s properties as much as you want.
import rhinoscriptsyntax as rs
from System.Drawing import Color
new_element = rs.GetString("New Element?")
new_element = new_element[0].upper()+new_element[1:]
rs.AddLayer(new_element)
crv_layer_name = rs.AddLayer("crv"+new_element, Color.Red, parent=new_element)
rs.LayerPrintWidth(crv_layer_name, -1)