Hello, is there anybody in there?
Function, which should create new layout, a copy of available layout, in one
document, written on C#:
================
private void layout_new(String strFrom, String strTo,
Autodesk.AutoCAD.Interop.AcadDocument doc)
{
Autodesk.AutoCAD.Interop.Common.AcadLayout objLayOut;
Autodesk.AutoCAD.Interop.Common.AcadLayout objNewLayOut;
objNewLayOut = doc.Layouts.Add(strTo);
objLayOut=colLayOuts.Item(strFrom);
object[] objEntArray = new object[objLayOut.Block.Count];
int intCnt = 0;
foreach (Autodesk.AutoCAD.Interop.Common.AcadObject objEnt in
objLayOut.Block)
{
objEntArray[intCnt] = objEnt;
intCnt=intCnt+1;
}
try
{
doc.CopyObjects(objEntArray[1], objNewLayOut.Block,
ref missing);
objNewLayOut.CopyFrom((Autodesk.AutoCAD.Interop.Common.AcadPlotConfiguration)objLayOut);
}
catch (System.Exception ex)
{
System.Windows.Forms.MessageBox.Show(ex.ToString());
}
}
================
Gives out a COMException (0x8021007B) "Incorrect file of objects"
at line "doc.CopyObjects(objEntArray[1], objNewLayOut.Block, ref missing);"
Prompt, please, in what there can be a problem?
Beforehand thanks!
Wish you were here, All!
np: Jimmy Page - Liquid Mercury