www.mxdraw.com
|
增加一个外部块参照。
static McDbObjectId Mx_AddNewXRefDefBlock(CString pathName, CString blockName);
参数 |
说明 |
CString pathName |
块参照文件路径 |
CString blockName |
块名. 块名不能为空. |
返回新增加的块记录id.如果块名已经了,就直接返回id.
例如: 增加外部参照代码,C#代码.
MxDrawResbuf param = new MxDrawResbuf(); param.AddString("block.dwg"); param.AddString("blkref"); MxDrawResbuf ret = (MxDrawResbuf)axMxDrawX1.CallEx("Mx_AddNewXRefDefBlock", param); if (ret.AtString(0) == "Ok") { axMxDrawX1.DrawBlockReference(0, 0, "blkref", 1.0, 0.0); } MxDrawBlockTableRecord blkRec = (MxDrawBlockTableRecord)ret.AtObject(1); ret = blkRec.GetProp("isFromExternalReference"); MessageBox.Show(ret.AtLong(0).ToString()); MxDrawResbuf ret2 = blkRec.GetProp("pathName"); MessageBox.Show(ret2.AtString(0));