- 积分
- 2848
- 明经币
- 个
- 注册时间
- 2004-7-28
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 mkhsj928 于 2024-7-10 13:57 编辑
以前一直用DLL导入acedTrans函数,其实在AutoCAD命名空间中有个Utility类就有TranslateCoordinates函数.
using AutoCAD;
using Autodesk.AutoCAD.Geometry;
public static Point3d TranslateCoordinate(this Point3d pt, AcCoordinateSystem from, AcCoordinateSystem to)
{
AcadDocument acadDoc = Autodesk.AutoCAD.ApplicationServices.Core.Application.DocumentManager.MdiActiveDocument.GetAcadDocument() as AcadDocument;
return new Point3d((double[])acadDoc.Utility.TranslateCoordinates(pt.ToArray(), from, to, 0));
}
|
|