当前位置:网站首页>2021-07-19C#CAD二次开发创建多线段
2021-07-19C#CAD二次开发创建多线段
2022-07-02 06:23:00 【徐记荣】
代码如下:
/// <summary>
/// 绘制折线多线段
/// </summary>
/// <param name="db">图形数据库</param>
/// <param name="isClosed">是否闭合</param>
/// <param name="contantWidth">线宽</param>
/// <param name="vertices">多线段的定点,可变参数</param>
/// <returns>ObjectId</returns>
public static ObjectId AddPolyLineToModelSpace(Database db, bool isClosed, double contantWidth, params Point2d[] vertices)
{
if (vertices.Length < 2)
{
return ObjectId.Null;
}
//声明一个多段线对象
Polyline pLine = new Polyline();
//添加多线段的顶点
for (int i = 0; i < vertices.Length; i++)
{
pLine.AddVertexAt(i, vertices[i], 0, 0, 0);
}
if (isClosed)
{
pLine.Closed = true;
}
//设置多线段的线宽
pLine.ConstantWidth = contantWidth;
return AddEnityTool.AddEnityToModelSpace(db, pLine);
}
polyline可添加的属性
public void AddVertexAt(int index, Point2d pt, double bulge, double startWidth, double endWidth);
index:添加点的序号
pt:添加的点
bulge:凸度
startWidth:开始宽度
endWidth:结束时宽度
凸度的定义:
设圆弧所包含的圆心角为A(弧度表示),则凸度=四分之一圆心角之正切值
C#表示:
凸度=sin(A/4)/cos(A/4)
边栏推荐
- No process runs when querying GPU, but the video memory is occupied
- pytest(1) 用例收集规则
- js创建一个自定义json数组
- 【文献阅读与想法笔记13】 Unprocessing Images for Learned Raw Denoising
- Win10: add or delete boot items, and add user-defined boot files to boot items
- Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
- 20201002 vs 2019 qt5.14 developed program packaging
- Wechat applet Foundation
- The use of regular expressions in JS
- Review of reflection topics
猜你喜欢
js中对于返回Promise对象的语句如何try catch
SQLI-LABS通关(less6-less14)
js中map和forEach的用法
In depth study of JVM bottom layer (V): class loading mechanism
Flex Jiugongge layout
The use of regular expressions in JS
Latest CUDA environment configuration (win10 + CUDA 11.6 + vs2019)
Redis -- cache breakdown, penetration, avalanche
The table component specifies the concatenation parallel method
The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem
随机推荐
Review of reflection topics
Utilisation de la carte et de foreach dans JS
Anti shake and throttling of JS
20201002 vs 2019 qt5.14 developed program packaging
Queue (linear structure)
Functions of tensorrt
CVE-2015-1635(MS15-034 )遠程代碼執行漏洞複現
In depth study of JVM bottom layer (IV): class file structure
蚂蚁集团g6初探
Usage of map and foreach in JS
UEditor .Net版本任意文件上传漏洞复现
Win电脑截图黑屏解决办法
Pytest (3) parameterize
工具种草福利帖
JS create a custom JSON array
默认google浏览器打不开链接(点击超链接没有反应)
Win10桌面图标没有办法拖动(可以选中可以打开可以删除新建等操作但是不能拖动)
Win10:添加或者删除开机启动项,在开机启动项中添加在用户自定义的启动文件
Uploading attachments using Win32 in Web Automation
There are multiple good constructors and room will problem