chpmould 发表于 2010-12-5 21:15:00

定义一个直线的函数

如何定义以下二种方法画一个直线的函数

chpmould 发表于 2010-12-5 21:16:00

复制代码

雪山飞狐_lzh 发表于 2010-12-5 21:34:00

这个没有必要做函数的

chpmould 发表于 2010-12-5 21:41:00

狐哥请示范一下: 我是想学习一下方法...

雪山飞狐_lzh 发表于 2010-12-5 22:01:00

这个还真没有做过,也没必要
只需要做个添加的
public static ObjectId AddEntity(this BlockTableRecord btr, Transaction tr, Entity entity)
{
    ObjectId id = btr.AppendEntity(entity);
    tr.AddNewlyCreatedDBObject(entity, true);
    return id;
}

chpmould 发表于 2010-12-5 22:19:00

谢谢!!! 我再去学习一下做一些子函,这样以后会方便很多...

cdinten 发表于 2010-12-7 10:43:00

你可以重载该函数

cdinten 发表于 2010-12-7 10:45:00


//ObjectId Cir03 = AddLineb(new Point3d(15, 0, 0), new Point3d(-15, 0, 0));
public static ObjectId AddLine()
{
Point3d pt1=new Point3d(15, 0, 0),;
Point3d pt2=new Point3d(-15, 0, 0));
Line ent = new Line(pt1, pt2);
ObjectId entId = AppendEntity(ent);
return entId;
}

chpmould 发表于 2010-12-7 12:25:00

谢谢楼上的朋友,这种方法我知道,我现在的遇到的问题是,在新建一个块时无法选取ObjectId Cir03 返回的ID
页: [1]
查看完整版本: 定义一个直线的函数