当前位置:网站首页>2021-07-19c CAD secondary development creates multiple line segments
2021-07-19c CAD secondary development creates multiple line segments
2022-07-02 06:59:00 【Xu Jirong】
The code is as follows :
/// <summary>
/// Draw polyline segments
/// </summary>
/// <param name="db"> Graphic database </param>
/// <param name="isClosed"> Is it closed? </param>
/// <param name="contantWidth"> Line width </param>
/// <param name="vertices"> Fixed point of multi segment , Variable parameters </param>
/// <returns>ObjectId</returns>
public static ObjectId AddPolyLineToModelSpace(Database db, bool isClosed, double contantWidth, params Point2d[] vertices)
{
if (vertices.Length < 2)
{
return ObjectId.Null;
}
// Declare a polyline object
Polyline pLine = new Polyline();
// Add vertices of multiple segments
for (int i = 0; i < vertices.Length; i++)
{
pLine.AddVertexAt(i, vertices[i], 0, 0, 0);
}
if (isClosed)
{
pLine.Closed = true;
}
// Set the lineweight of multiple line segments
pLine.ConstantWidth = contantWidth;
return AddEnityTool.AddEnityToModelSpace(db, pLine);
}
polyline Attributes that can be added
public void AddVertexAt(int index, Point2d pt, double bulge, double startWidth, double endWidth);
index: Add the sequence number of the point
pt: Added points
bulge: Convexity
startWidth: Start width
endWidth: End width
Definition of convexity :
Let the center angle of the arc be A( Radians indicate ), Then convexity = Tangent value of quarter circle center angle
C# Express :
Convexity =sin(A/4)/cos(A/4)
边栏推荐
猜你喜欢

sqli-labs通关汇总-page4

Sentry construction and use

UEditor .Net版本任意文件上传漏洞复现

No process runs when querying GPU, but the video memory is occupied

In depth study of JVM bottom layer (IV): class file structure

Sentry搭建和使用

Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件

Win10: add or delete boot items, and add user-defined boot files to boot items

Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved

SQLI-LABS通關(less6-less14)
随机推荐
php中删除指定文件夹下的内容
js中对于返回Promise对象的语句如何try catch
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
sqli-labs通关汇总-page1
Sublime text configuring PHP compilation environment
Kali latest update Guide
Self study table Au
php中判断版本号是否连续
Solve the problem of bindchange event jitter of swiper component of wechat applet
Sqli-labs customs clearance (less15-less17)
Brief analysis of PHP session principle
Automation - when Jenkins pipline executes the nodejs command, it prompts node: command not found
Fe - wechat applet - Bluetooth ble development research and use
js的防抖和节流
VSCODE 安装LATEX环境,参数配置,常见问题解决
Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved
js删除字符串的最后一个字符
Linux MySQL 5.6.51 Community Generic 安装教程
In depth study of JVM bottom layer (V): class loading mechanism
In depth study of JVM bottom layer (IV): class file structure