Hi, I just joined.
As the title of my topic says, I, like others before me, want to change edge colors from code. I have read all the relevant threads on this forum going back years, and there have been several people inquiring about the same issue, so I’m not alone in this quest, but I have not seen anything that would answer our need. Some advise to do it with PaintBucket but that’s a manual operation. That’s not what we want. So, could anyone tell me please, why this snippet does not work (line color remains black), and how to go about it?
model = Sketchup.active_model
entities = model.entities
view = model.active_view
pts = 
pts = [0, 0, 0]
pts = [30, 0, 0]
pts = [40, 60, 0]
line0 = entities.add_line(pts, pts)
line1 = entities.add_line(pts, pts)
line2 = entities.add_line(pts, pts)
line2.material = "red"
And the output is:
So, the first puts prints a blank line because the material has has not been set yet, then after: line2.material = "red"
the second puts prints it as something. Is that something a black color and that’s why it is drawn black, or is it a red color but disregarded because of some setting, or is it red but the line was drawn first with black color and then not redrawn even though I tried to refresh the view and the problem lies with the refresh, or is it something else?
I’m on a Win7 machine, using Sketchup Make 16.1.1449 64-bit