当前位置:网站首页>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)
边栏推荐
- php中树形结构转数组(拉平树结构,保留上下级排序)
- Sqli - Labs Clearance (less6 - less14)
- Overload global and member new/delete
- ts和js区别
- Laravel8中的find_in_set、upsert的使用方法
- Improve user experience defensive programming
- php中计算两个日期之前相差多少天、月、年
- Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
- Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence
- SQL injection closure judgment
猜你喜欢
Vscode installation, latex environment, parameter configuration, common problem solving
How to debug wechat built-in browser applications (enterprise number, official account, subscription number)
SQLI-LABS通关(less1)
微信小程序基础
The win10 network icon disappears, and the network icon turns gray. Open the network and set the flash back to solve the problem
In depth study of JVM bottom layer (V): class loading mechanism
uniapp引入本地字体
Sqli labs customs clearance summary-page3
Utilisation de la carte et de foreach dans JS
[literature reading and thought notes 13] unprocessing images for learned raw denoising
随机推荐
Blog directory of zzq -- updated on 20210601
Cve-2015-1635 (ms15-034) Remote Code Execution Vulnerability recurrence
pm2简单使用和守护进程
Fe - wechat applet - Bluetooth ble development research and use
Atcoder beginer contest 253 F - operations on a matrix / / tree array
In depth study of JVM bottom layer (IV): class file structure
Common function writing method and set get writing method for calculating attributes
2021-07-17C#/CAD二次开发创建圆(5)
JS divides an array into groups of three
The use of regular expressions in JS
CTF web practice competition
Underlying mechanism mvcc
CVE-2015-1635(MS15-034 )远程代码执行漏洞复现
Improve user experience defensive programming
In depth study of JVM bottom layer (II): hotspot virtual machine object
Automation - when Jenkins pipline executes the nodejs command, it prompts node: command not found
Thinkphp5中一个字段对应多个模糊查询
[leetcode question brushing day 35] 1060 Missing element in ordered array, 1901 Find the peak element, 1380 Lucky number in matrix
Sentry搭建和使用
PgSQL learning notes