i am trying to convert dgn file to pdf file and that pdf file has to be get printed.not able to convert dgn file to pdf file in bentley microstation v8i. Previous it was working in bentley microstation v7.
code :
for (i = 0; i < dt.Rows.Count; i++) { oCopyContext = new CopyContextClass(); Element ele = default(Element); DLong Id = default(DLong); Id.High = 0; Id.Low = Convert.ToInt32(dt.Rows[i][0].ToString());
{ ele = (Element)(ofile.DefaultModelReference.GetElementByID(ref Id)); if (ele != null) { ele.IsLocked = false; ele.Color = 152; ofile.DefaultModelReference.CopyElement(ele, oCopyContext); } } }
error at the line : ofile.DefaultModelReference.CopyElement(ele, oCopyContext);
source : Interop.MicroStationDGN
stack Trace : at MicroStationDGN.ModelReferenceClass.CopyElement(_Element Element, CopyContext CopyContext) at Xorail.CADAutomation.CADInterface.BentleyInterfaceBase.StartPDFForSingleFileComparer(String designfile, String outFileName, String pdfpath, DataTable dt, DataTable dt1, String Filetype) in d:\VisualStudioProjects\CADAutomation\CADInterface\BentleyInterfaceBase.cs:line 10124
please provide me solution..its much needed.
Please follow the MicroStation Programming forum best practices.
Please identify the version of MicroStation, or other product such as PowerDraft, that you are using: MicroStation CONNECT or MicroStation V8i. What is the 8-digit version number (e.g. 10.xx.yy.zz) of MicroStation?
If you're using MicroStation in a ProjectWise (PW) managed environment, let us know that too.
The APIs supplied with MicroStation CONNECT are different to those supplied with MicroStation V8i. Consequently, our answers are likely to be different.
Please identify the version of Windows you are using. Is this 32-bit or 64-bit Windows?
Are you writing MDL, C++, C#, VB.NET or MicroStation VBA?
If you're creating a .NET application, are you building an AddIn in-process app. (i.e. a DLL) or a stand-alone app. (i.e. an EXE)?
Are you using Visual Studio or Bentley Make (bmake) to build your project? What version of Visual Studio are you using?
When you post code, use the Forum advanced editor's syntax highlighting tool. That's the icon that resembles a pencil:
Regards, Jon Summers LA Solutions
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point