netdxf中修改多段線線寬

elepeipei發表於2024-11-12

嘗試了thinkness,不對
嘗試了Lineweight,不對
嘗試輸入start時候居然出來個SetConstantWidth,試了一下對了

private void InsertRec(PointF leftDownPt, PointF rightTopPt, AciColor color, DxfDocument doc, Lineweight lineweight = Lineweight.Default, bool close = true)
{
	var recPointFs = new List<PointF> { leftDownPt };
	recPointFs.Add(new PointF(rightTopPt.X, leftDownPt.Y));
	recPointFs.Add(rightTopPt);
	recPointFs.Add(new PointF(leftDownPt.X, rightTopPt.Y));
	Polyline2D pyline = new Polyline2D(recPointFs.Select(o => new Vector2(o.X, o.Y)).ToList());
	pyline.Color = color;
	pyline.Lineweight = lineweight;//不對
	pyline.SetConstantWidth(5);
	pyline.IsClosed = close;
	doc.Entities.Add(pyline);

}

相關文章