点的各种坐标系之间的转换
本帖最后由 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));
}
调用方法?矩阵变换手写都可以啦 point3d有TransformBy方法,另外请不要在net区发com
页:
[1]