加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

Revit二次开发之创建详图线并赋予颜色

(2016-10-12 21:54:47)
标签:

365

it

分类: Revit二次开发
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
UIApplication app = commandData.Application;
Document doc = app.ActiveUIDocument.Document;
View view = doc.ActiveView;

Transaction ts = new Transaction(doc,"BIM");
ts.Start();

XYZ startPoint = new XYZ(0, 0, 0);
XYZ endPoint = new XYZ(10, 10, 0);
Line geomLine =Line.CreateBound(startPoint, endPoint);

DetailLine line = doc.Create.NewDetailCurve(view, geomLine) as DetailLine;

GraphicsStyle gs = line.LineStyle as GraphicsStyle;
gs.GraphicsStyleCategory.LineColor= new Color(255, 0, 0);
ts.Commit();
return Result.Succeeded;
}

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有