CAD将图块替换成dwg文件(网页版)

js中使用如下:

var ent = mxOcx.GetEntity("选择图面的属性块:");

if(ent == null)

{

    return;

}

if (ent.ObjectName != "McDbBlockReference") {

    alert("选择的对象不是块引用");

}

else

{

    var blkref = ent;

    var sBlkFilePath = mxOcx.GetOcxAppPath() + "\\Blk\\Rect.dwg";

    mxOcx.InsertBlock(sBlkFilePath, "MyBlk2");

 

    var curDatabase = mxOcx.GetDatabase();

    var blkTable = curDatabase.GetBlockTable();

    var myblkRec =  blkTable.GetAt("MyBlk2"false);

    if(myblkRec == null)

    {

        return;

    }

    blkref.BlockTableRecordId = myblkRec.ObjectID;

}

上一篇:SpringDataJpA复杂查询实现自定义排序


下一篇:SQL server分页的四种方法(算很全面了)