Autocad.net Implementing CAD Screenshots

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.