There are several ways in which AutoCAD is implemented using C #:
1, using the export of CAD, Jpgout, pngout, you can export the entity of the selection set into a picture, But to use COM's interface to set Activeselectionset (Autocad.net interface setimpliedselection seems to be not), and then using COM or send a command to call the export, Jpgout, PNGOut and other commands, the reference code is as follows (only test export, no test jpgout, PNGOut and Other methods):
ObjectOCad =Autodesk.AutoCAD.ApplicationServices.Application.AcadApplication; Type Tpcad=Ocad.gettype ();Objectodoc = Tpcad.invokemember ("ActiveDocument", System.Reflection.BindingFlags.GetProperty,NULL, OCad,NULL); Type Tpdoc=Odoc.gettype ();ObjectThe Tpdoc.invokemember ("Activeselectionset", System.Reflection.BindingFlags.GetProperty,NULL, odoc,NULL); Tpdoc.invokemember ("Export", System.Reflection.BindingFlags.InvokeMethod,NULL, odoc,New Object[] {path +"\\ABC","WMF", "the"); Ed. Setimpliedselection (NewObjectid[] {});
2, use View.getsnapshot to capture screen, specific can refer to here.
3. Use the Print function to print DWG drawings to PDF, then convert the PDF to a picture, where exporting the PDF should also be done by calling the CAD COM interface, while the PDF-to-picture can use Adobe's COM components (Adobe Acrobat xx Type Library) , or other third-party components (refer to here).
Autocad.net Implementing CAD