www.mxdraw.com
内容索引主面
前一个向上下一个
IMxDrawBlockTable 接口

数据库中的块表类型,块表中存放着块表记录,我们常见的模型空间就是块表中名为*Model_Space 的块表记录

IDL
[ object, uuid(E4F220B9-A9DD-42AF-B47C-49E13737A590), dual, nonextensible, helpstring("IMxDrawBlockTable interface"), pointer_default(unique) ]
interface IMxDrawBlockTable : IMxDrawSymbolTable;

MxDrawBlockTable.idl

例如: C# 判断当前数据库中,是有指定的块表记录.

     MxDrawDatabase data = (MxDrawDatabase)axMxDrawX1.GetDatabase();
     if (data.GetBlockTable().Has("BlkName"))
     {
         // 已经插入.
     }

 

例如: C# 得到所有图块名

       MxDrawDatabase databae = (MxDrawDatabase)axMxDrawX1.GetDatabase();
     MxDrawBlockTable blkTab = databae.GetBlockTable();
     MxDrawBlockTableIterator iter = blkTab.NewIterator();
     for (; !iter.Done(); iter.Step())
     {
         MxDrawBlockTableRecord blkRec = iter.GetRecord();
         MessageBox.Show(blkRec.Name);
    
     }

 

例如: C# 模型空间下所有实体

        MxDrawDatabase database = (MxDrawDatabase)axMxDrawX1.GetDatabase();
        MxDrawBlockTableRecord blkRec = database.GetBlockTable().GetAt("*Model_Space");
        MxDrawBlockTableRecordIterator iter = blkRec.NewIterator();

          if (iter == null)
            return;


        int iNum = 0;
        // 循环得到所有实体

        for (; !iter.Done(); iter.Step(true, false))
        {
            // 得到遍历器当前的实体
            iNum++;

        }
        MessageBox.Show(iNum.ToString());
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!