DBX 修改块名出错,求解救!
public void DrawingPretreatment()//String fileFullName, String curNumber){
String fileFullName = @"E:\001.dwg";
String curNumber = "1";
string progid = "ObjectDBX.AxDbDocument.16";
AxDbDocument objDbx = (AxDbDocument)acadApp.GetInterfaceObject(progid);
objDbx.Open(fileFullName, null);
foreach (AcadEntity entity in objDbx.ModelSpace)
{
switch (entity.EntityName)
{
case "AcDbBlockReference":
AcadBlockReference blkRef;
blkRef = (AcadBlockReference)entity;
try
{
blkRef.Name = blkRef.Name + curNumber;//这里出错
}
catch (Autodesk.AutoCAD.Runtime.Exception ex)
{
throw new System.Exception(ex.Message);
}
break;
case "AcDbOrdinateDimension":
break;
}
}
objDbx.SaveAs(fileFullName, null);
objDbx = null;
}
AutoCAD 2005& vs2008
页:
[1]