reclosedev / pyautocad

AutoCAD Automation for Python ⛺
http://pypi.python.org/pypi/pyautocad/
BSD 2-Clause "Simplified" License
506 stars 143 forks source link

change line weight and color #43

Open youssef962 opened 2 years ago

youssef962 commented 2 years ago

I know how to draw lines, but can I change the drawn line weight and color?

Eligio-Cazo commented 2 years ago

Hi. I have some questions here, but nobody answers me. Regarding your query, try this:

    Line = Acad.Activedocument.ModelSpace.AddLine(p1, p2)
    Line.color=5 # Color number 0 to 255, which are autocad colors, color 256 is assigned as a bylayer must be a integer.
    Line.Lineweight='0.18' # A string Value, must be between '0.00' and '2.11'
youssef962 commented 2 years ago

@Eligio-Cazo Thanks for your reply! If you have any questions I might help.