zoukankan
html css js c++ java
AutoCAD.net: 求空间两曲线交点
引自:http://www.objectarx.net/bbs/archiver/?tid-410.html
using
System;
using
System.Collections.Generic;
using
System.Text;
using
Autodesk.AutoCAD.ApplicationServices;
using
Autodesk.AutoCAD.Colors;
using
Autodesk.AutoCAD.DatabaseServices;
using
Autodesk.AutoCAD.EditorInput;
using
Autodesk.AutoCAD.Geometry;
using
Autodesk.AutoCAD.Runtime;
using
AsApp
=
Autodesk.AutoCAD.ApplicationServices.Application;
using
DsTM
=
Autodesk.AutoCAD.DatabaseServices.TransactionManager;
using
Autodesk.AutoCAD.GraphicsInterface;
using
Autodesk.AutoCAD.Interop;
namespace
ObjectArxNet.Test
{
/**/
///
<summary>
///
求空间两曲线交点
///
</summary>
public
class
Intersection
{
[CommandMethod(
"
IntersectionTest
"
)]
public
void
IntersectionTest()
{
Editor m_ed
=
Application.DocumentManager.MdiActiveDocument.Editor;
Database m_db
=
HostApplicationServices.WorkingDatabase;
PromptEntityOptions m_peo
=
new
PromptEntityOptions(
"
\n请选择第一条曲线:
"
);
PromptEntityResult m_per
=
m_ed.GetEntity(m_peo);
if
(m_per.Status
!=
PromptStatus.OK)
{
return
; }
ObjectId m_objid1
=
m_per.ObjectId;
m_peo
=
new
PromptEntityOptions(
"
\n请选择第二条曲线:
"
);
m_per
=
m_ed.GetEntity(m_peo);
if
(m_per.Status
!=
PromptStatus.OK)
{
return
; }
ObjectId m_objid2
=
m_per.ObjectId;
using
(Transaction m_tr
=
m_db.TransactionManager.StartTransaction())
{
Curve m_cur1
=
(Curve)m_tr.GetObject(m_objid1, OpenMode.ForRead);
Curve m_cur2
=
(Curve)m_tr.GetObject(m_objid2, OpenMode.ForRead);
Point3dCollection m_ints
=
new
Point3dCollection();
m_cur1.IntersectWith(m_cur2, Intersect.OnBothOperands,
new
Plane(), m_ints,
0
,
0
);
//
得出的所有交点在c1曲线上
foreach
(Point3d m_pt
in
m_ints)
{
m_ed.WriteMessage(
"
\n第一条曲线与第二条曲线交点:{0}
"
, m_pt);
}
m_ed.WriteMessage(
"
\n===
"
);
m_ints.Clear();
m_cur2.IntersectWith(m_cur1, Intersect.OnBothOperands,
new
Plane(), m_ints,
0
,
0
);
//
得出的所有交点在c2曲线上
foreach
(Point3d m_pt
in
m_ints)
{
m_ed.WriteMessage(
"
\n第二条曲线与第条曲线一交点:{0}
"
, m_pt);
}
m_tr.Commit();
}
}
}
}
查看全文
相关阅读:
python中有哪些类型的布尔值是False?
django中间件(获取请求ip)
用python进行月份加减的函数
Python取整函数
Python里面search()和match()的区别
在追灿公司的学习笔记
Maven学习笔记
天梯赛练习 L3-006 迎风一刀斩 (30分) 几何关系
PAT甲级 1155 Heap Paths (30分) 堆模拟
天梯赛练习 L3-016 二叉搜索树的结构 (30分)
原文地址:https://www.cnblogs.com/wf225/p/1263194.html
最新文章
win10在python3.6里安装pycrypto-2.6.1
python调用dll详解
Dart学习笔记-循环
Dart学习笔记-运算符-条件表达式-类型转换
Dart学习笔记-变量常量数据类型
win10安装mysql-最简单教程
域名查询是否注册的demo
python生成密码字典
python检测进程是否存在
python分割txt文件
热门文章
在Ubuntu中安装Docker和docker的使用
ubuntu服务器允许Root用户登录
PyQt5学习一---环境的安装和配置
Git简易的命令行入门教程:
Django开启https(不用nginx)
自动爬取代理IP例子
阿里云对象存储调用例子
百度人脸识别python调用例子
sql优化的几种方法
django框架ORM数据库
Copyright © 2011-2022 走看看