How to change display line width?

@Vaker,

not sure which language you use. Below is a python example on how to change the print width for one or more curves. To see the results in the viewport, make sure to enable print display using the _PrintDisplay command before running the script.

import Rhino
import scriptcontext
import rhinoscriptsyntax as rs
    
def ChangePlotWeight(plot_weight=0):
    ids = rs.GetObjects("Select curves", rs.filter.curve, False, True, False)
    if not ids: return
    
    pws = Rhino.DocObjects.ObjectPlotWeightSource.PlotWeightFromObject
    
    for id in ids:
        rh_obj = rs.coercerhinoobject(id, True, True)
        rh_obj.Attributes.PlotWeightSource = pws
        rh_obj.Attributes.PlotWeight = plot_weight
        rh_obj.CommitChanges()
    scriptcontext.doc.Views.Redraw()
    
if __name__=="__main__":
    ChangePlotWeight(plot_weight=2.0)

Note that running the function above without providing the argument plot_weight will reset the plot weight to the default value 0 (hairline). A negative value will set the curve plot weight to “no print”.

c.