如何使生成的文字在多边形的外面!
如何使生成的文字在多边形的外面!发个图看看:如果我是ssget一框选已打散的(list '(0 . "LWPOLYLINE"))线怎么分别四条线相对于其中心的方位?
复制代码LoopList类在这里找
测试代码:
public static void Test4()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
PromptEntityOptions optsEnt = new PromptEntityOptions("\nSelect a LWPolyLine:");
optsEnt.SetRejectMessage("\nNot a LWPolyLine!");
optsEnt.AddAllowedClass(typeof(LWPolyline), false);
PromptEntityResult resEnt = ed.GetEntity(optsEnt);
if (resEnt.Status == PromptStatus.OK)
{
Database db = doc.Database;
using (Transaction tr = db.TransactionManager.StartTransaction())
{
LWPolyline pl = tr.GetObject(resEnt.ObjectId, OpenMode.ForRead) as LWPolyline;
var ptlst =
Enumerable
.Range(0, pl.NumberOfVertices)
.Select(i => pl.GetPoint2dAt(i));
PromptPointOptions optPnt = new PromptPointOptions("\nInput a Point:");
optPnt.AllowNone = true;
PromptPointResult resPnt = ed.GetPoint(optPnt);
while (resPnt.Status == PromptStatus.OK)
{
var res = ptlst.PointOnRegion(resPnt.Value.Convert2d(new Plane()));
ed.WriteMessage("\nPoint:{0},Result:{1}" ,resPnt.Value, res);
resPnt = ed.GetPoint(optPnt);
}
}
}
}
支持版主的解决方案,学习一下。
VB.NET 2010不能在调试期间编辑lambda表达式代码,必须停止调试退出AutoCAD,C#是这样吗?
如果这个问题不能解决,势必限制了Linq的应用,反复启动AutoCAD实在太麻烦。
高难,还不懂,学习一下。 太厉害了。
学习中 很少在调试阶段编辑代码,一般只有在Cad爆掉才,呵呵
现在总是不断地开Cad的,哎
习惯了,汗 我经常在调试阶段编辑代码,如果编辑的代码不是当前运行的那行,一般调试是不会中断的,可以实时的看到效果,这样就不用重复启动CAD了。 lambda在C#里也无法调试。呵呵
又多了一个调试阶段不能编辑的因素。
AutoCAD .NET其它方面都还不错,就是这个调试,比起lisp和VBA的方便程度差太多。
最要命的是调试时不能修改窗体,难以想象大量的对话框迁移起来该多麻烦。
页:
[1]
2