当前位置:网站首页>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)
边栏推荐
- 看完有用的blog
- sqli-labs通关汇总-page3
- 20201025 visual studio2019 qt5.14 use of signal and slot functions
- JS create a custom JSON array
- Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence
- js删除字符串的最后一位
- Win10: add or delete boot items, and add user-defined boot files to boot items
- js中对于返回Promise对象的语句如何try catch
- Utilisation de la carte et de foreach dans JS
- Latex compilation error I found no \bibstyle &\bibdata &\citation command
猜你喜欢

Win电脑截图黑屏解决办法

Présence d'une panne de courant anormale; Problème de gestion de la fsck d'exécution résolu

Uploading attachments using Win32 in Web Automation

sqli-labs通关汇总-page3

pytest(2) mark功能

Latex error: the font size command \normalsize is not defined problem solved
![[Zhang San learns C language] - deeply understand data storage](/img/b5/cf0bfae8eacf335d3c350c9cbadb87.png)
[Zhang San learns C language] - deeply understand data storage

Thread hierarchy in CUDA

QQ email cannot receive the email sent by Jenkins using email extension after construction (timestamp or auth...)

Win10网络图标消失,网络图标变成灰色,打开网络设置闪退等问题解决
随机推荐
SQL注入闭合判断
Asynchronous data copy in CUDA
Sublime text configuring PHP compilation environment
浏览器滚动加载更多实现
js删除字符串的最后一个字符
Sqli labs customs clearance summary-page3
Solve the problem of bindchange event jitter of swiper component of wechat applet
selenium备忘录:selenium\webdriver\remote\remote_connection.py:374: ResourceWarning: unclosed<xxxx>解决办法
table 组件指定列合并行方法
Latex compilation error I found no \bibstyle &\bibdata &\citation command
Unexpected inconsistency caused by abnormal power failure; Run fsck manually problem resolved
Browser scrolling for more implementations
pytest(3)parametrize参数化
Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
SQLI-LABS通关(less15-less17)
Vector types and variables built in CUDA
Implement strstr() II
js中对于返回Promise对象的语句如何try catch
Function execution space specifier in CUDA
pytest(2) mark功能