面
形元素(ShapeElemnet)
形元素的创建 方式为首先 定义形元素端点,而后添加到端点集中,然后使用端点集创建形元素
public static void CmdCreateShape(string unparsed)
{
DgnModel dgnModel = Session.Instance.GetActiveDgnModel();//获取当前的模型空间
DPoint3d p1 = new DPoint3d(-10000, 10000, 0);//创建面元素端点
DPoint3d p2 = new DPoint3d(10000, 10000, 0);
DPoint3d p3 = new DPoint3d(10000, -10000, 0);
DPoint3d p4 = new DPoint3d(-10000, -10000, 0);
DPoint3d[] pos = {
p1, p2, p3, p4 };//将面元素端点添加到面元素端点数组中
ShapeElement shape = new ShapeElement(dgnModel,null, pos);//创建形元素
shape.AddToModel();//将面元素写入模型
}
椭圆元素(EllipseElement)
第一种创建椭圆 元素的方式 是 通过设置椭圆 的圆心,主轴 及副轴向量创建椭圆几何,然后使用椭圆集合创建椭圆元素
public static void CmdCreateEllipse1(string unparsed)
{
DgnModel dgnModel = Session.Instance.GetActiveDgnModel();//获取当前的模型空间
DPoint3d centerPo = DPoint3d.Zero;//创建圆心
DVector3d vector0In = new DVector3d(20000, 0, 0);//创建主轴向量
DVector3d vector90In = new DVector3d(0, 10000, 0);//创建副轴向量
DEllipse3d ellipse = new