qq1254582201 发表于 2021-4-9 18:08:00

C# 根据Objectid 判断图块是在模型还是布局(图元所在的空间)

ObjectId objectid = ObjectId.Null; ;
BlockReference blkRef= trans.GetObject(objectid ,OpenMode.ForRead) as BlockReference;
BlockTableRecord data = trans.GetObject(blkRef.OwnerId, OpenMode.ForRead) as BlockTableRecord ;
Layout ly = data.LayoutId.GetObject(OpenMode.ForRead) as Layout;
//获取 布局名称
string name1 = ly.LayoutName;
页: [1]
查看完整版本: C# 根据Objectid 判断图块是在模型还是布局(图元所在的空间)