首先说明,在UG二次开发时,读取的点坐标是工作部件绝对坐标系点坐标,不是WCS的坐标。
为了实现绝对坐标系到选择的坐标系变换,设计了一个验证示例。
其UI界面如下:
其变换代码如下:
#region 坐标系变换 Point3d origionPoint3D = new Point3d(); //定义工作部件绝对坐标系的位置点坐标Point point = (Point)pointTaggedObjects[0]; //选择的点对象origionPoint3D = point.Coordinates;//位置点坐标赋值CoordinateSystem coordinateSystem = null; //定义坐标系对象