Change lineweight of a line

Change lineweight of a line

Anonymous
Not applicable
778 Views
1 Reply
Message 1 of 2

Change lineweight of a line

Anonymous
Not applicable

Let's say I have a line

 

Line line = new Line(new Point3d(0,0,0),new Point3d(0,10,0));

How can I change the lineweight for this line?

0 Likes
Accepted solutions (1)
779 Views
1 Reply
Reply (1)
Message 2 of 2

_gile
Consultant
Consultant
Accepted solution

Hi,

 

The Entity type have a LineWeight property which is a LineWeight enum type.

 

From the docs:

 

 

public enum LineWeight {
  ByBlock = -2,
  ByLayer = -1,
  ByLineWeightDefault = -3,
  LineWeight000 = 0,
  LineWeight005 = 5,
  LineWeight009 = 9,
  LineWeight013 = 13,
  LineWeight015 = 15,
  LineWeight018 = 0x12,
  LineWeight020 = 20,
  LineWeight025 = 0x19,
  LineWeight030 = 30,
  LineWeight035 = 0x23,
  LineWeight040 = 40,
  LineWeight050 = 50,
  LineWeight053 = 0x35,
  LineWeight060 = 60,
  LineWeight070 = 70,
  LineWeight080 = 80,
  LineWeight090 = 90,
  LineWeight100 = 100,
  LineWeight106 = 0x6a,
  LineWeight120 = 120,
  LineWeight140 = 140,
  LineWeight158 = 0x9e,
  LineWeight200 = 200,
  LineWeight211 = 0xd3
}

 

 

Using example:

 

 

Line line = new Line(new Point3d(0,0,0),new Point3d(0,10,0));
line.LineWeight = LineWeight.LineWeight035;

 

 

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub