Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the AutoCAD processing control Aspose.CAD

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

In this article, the editor introduces in detail how to use the AutoCAD processing control Aspose.CAD for you. The content is detailed, the steps are clear, and the details are handled properly. I hope this article, "how to use the AutoCAD processing control Aspose.CAD, can help you solve your doubts." the following is followed by Xiaobian's idea of slowly deepening together to learn new knowledge.

Aspose.CAD for .NET is a stand-alone AutoCAD processing API. It provides the ability to convert DWG,DWF and DXF files to high-quality PDF and raster images. Developers can select and convert specific layouts and layers from AutoCAD files, and easily track the entire file conversion process.

Load large DWG files

Aspose.CAD for .NET provides the ability to open very large DWG files using the CadImage class. You can now easily open a large file using the example given below.

/ / path to the document directory .string MyDir = RunExamples.GetDataDir_DWGDrawings (); string filePathDWG = MyDir+ "TestBigFile.dwg"; string filePathFinish = MyDir+ "TestBigFile.dwg.pdf"; Stopwatch stopWatch = new Stopwatch (); try {stopWatch.Start (); using (CadImage cadImage = (CadImage) Image.Load (filePathDWG)) {stopWatch.Stop (); / / get the elapsed time as a timespan value. TimeSpan ts = stopWatch.Elapsed; / / formats and displays timespan values. String elapsedTime = String.Format ("{0:00}: {1:00}: {2:00}. {3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); Console.WriteLine ("RunTime for loading" + elapsedTime); CadRasterizationOptions rasterizationOptions = new CadRasterizationOptions (); rasterizationOptions.PageWidth = 1600; rasterizationOptions.PageHeight = 1600; PdfOptions pdfOptions = new PdfOptions () PdfOptions.VectorRasterizationOptions = rasterizationOptions; stopWatch = new Stopwatch (); stopWatch.Start (); cadImage.Save (filePathFinish, pdfOptions); stopWatch.Stop (); / / gets the elapsed time as a timespan value. Ts = stopWatch.Elapsed; / / formats and displays timespan values. ElapsedTime = String.Format ("{0:00}: {1:00}: {2:00}. {3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10); Console.WriteLine ("RunTime for converting" + elapsedTime);}} catch (Exception ex) {Console.WriteLine (ex.Message);} set a custom view for rendering

Aspose.CAD allows you to set custom viewpoints for model layouts. Use VectorRasterizationOptions to set custom viewpoints. The following example shows how to set a custom viewpoint.

/ / path to the document directory .string MyDir = RunExamples.GetDataDir_ConvertingCAD (); string sourceFilePath = MyDir + "conic_pyramid.dxf"; var outPath = Path.Combine (MyDir, "FreePointOfView_out.jpg"); using (CadImage cadImage = (CadImage) Image.Load (sourceFilePath)) {JpegOptions options = new JpegOptions {PageWidth = 1500, PageHeight = 1500}}; float xAngle = 10 / / rotation angle along the X axis float yAngle = 30; / / rotation angle along the Y axis float zAngle = 40; / / rotation angle along the Z axis ((CadRasterizationOptions) (options.VectorRasterizationOptions)). ObserverPoint = new ObserverPoint (xAngle, yAngle, zAngle); cadImage.Save (outPath, options) } after reading this, the article "how to use the AutoCAD processing control Aspose.CAD" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it yourself. If you want to know more about related articles, please follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report