.Net AutoCAD添加客户属性

问题描述 投票:-1回答:1

下面是命令结果:command - > (entget(car(entsel))(list "*"))

((-1 . <xx: 7ffffb14000>) (0 . "LWPOLYLINE") (330 . <xx: 7ffffb06a30>) (5 . "5968") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "LayerName") (6 . "Continuous") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0) (38 . 0.0) (39 . 0.0) (10 10035.5 13933.3) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (10 9323.13 14915.2) (40 . 0.0) (41 . 0.0) (42 . 0.0) (91 . 0) (210 0.0 0.0 1.0) (-3 ("CLEAR_WIRE" (1000 . "CWIRE") (1000 . "0") (1000 . "1") (1000 . "")) ("Wire Index" (1071 . 1))))

在我的代码PolyLineObject中,我没有看到“Wire Index”。如果我想添加“线索”,我该怎么办?

using (BlockTable BlockList = OperateTransaction.GetObject(ActiveDatabase.BlockTableId, OpenMode.ForRead) as BlockTable)
{
    foreach (ObjectId BlockId in BlockList)
    {
      BlockRecord = OperateTransaction.GetObject(BlockId, OpenMode.ForRead) as BlockTableRecord;
      foreach (ObjectId BlockRecordId in BlockRecord)
      {          
        if (BlockRecordId.ObjectClass.DxfName.Equals("LWPOLYLINE"))
        {
          PolylineObject = OperateTransaction.GetObject(BlockRecordId, OpenMode.ForRead) as Polyline;
        }
      }
    }
}
c# .net autocad autocad-plugin
1个回答
0
投票

这个“属性”称为XData,意思是扩展数据。通过.net使用它的示例您可以找到例如here

© www.soinside.com 2019 - 2024. All rights reserved.