AutoCAD处理控件Aspose.CAD怎么用
发表于:2024-09-21 作者:千家信息网编辑
千家信息网最后更新 2024年09月21日,本文小编为大家详细介绍"AutoCAD处理控件Aspose.CAD怎么用",内容详细,步骤清晰,细节处理妥当,希望这篇"AutoCAD处理控件Aspose.CAD怎么用"文章能帮助大家解决疑惑,下面跟
千家信息网最后更新 2024年09月21日AutoCAD处理控件Aspose.CAD怎么用
本文小编为大家详细介绍"AutoCAD处理控件Aspose.CAD怎么用",内容详细,步骤清晰,细节处理妥当,希望这篇"AutoCAD处理控件Aspose.CAD怎么用"文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。
Aspose.CAD for .NET是一个独立的AutoCAD处理API。它提供将DWG,DWF和DXF文件转换为高质量PDF和光栅图像的功能。开发人员可以从AutoCAD文件中选择和转换特定的布局和图层,并轻松跟踪整个文件转换过程。
加载大型DWG文件
Aspose.CAD for .NET提供了使用CadImage类打开非常大的DWG文件的功能。现在,您可以使用下面给出的示例示例轻松打开大文件。
//文档目录的路径.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(); // 将经过的时间作为TimeSpan值获取. TimeSpan ts = stopWatch.Elapsed; //格式化并显示TimeSpan值. 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(); //将经过的时间作为TimeSpan值获取. ts = stopWatch.Elapsed; //格式化并显示TimeSpan值. 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); }
设置自定义视图以进行渲染
Aspose.CAD允许您为模型布局设置自定义视点。使用VectorRasterizationOptions可以设置自定义视点。以下示例显示如何设置自定义视点。
//文档目录的路径.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 { VectorRasterizationOptions = new CadRasterizationOptions { PageWidth = 1500, PageHeight = 1500 } }; float xAngle = 10; //沿X轴的旋转角度 float yAngle = 30; //沿Y轴的旋转角度 float zAngle = 40; //沿Z轴的旋转角度 ((CadRasterizationOptions)(options.VectorRasterizationOptions)).ObserverPoint = new ObserverPoint(xAngle, yAngle, zAngle); cadImage.Save(outPath, options);}
读到这里,这篇"AutoCAD处理控件Aspose.CAD怎么用"文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注行业资讯频道。
文件
处理
控件
文章
示例
视点
角度
内容
功能
布局
文档
时间
格式
目录
路径
妥当
人员
光栅
图像
思路
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
通达信 代理服务器
大连市软件开发中专
怀柔区制造软件开发规定
企业软件开发部经理管理思路
vpn服务器 价格
河北机电软件开发公司
数据库 添加查找
健康app是否需要服务器
mysql 网站连接数据库
信阳公司财务软件开发
erp软件开发规划
长沙erp软件开发公司哪家强
在云服务器开店安全吗
服务器地图能不能在手机上用
邹平设备软件开发报价
服务器端口关管理
数据库系统的三级模式及其优点
软件开发与信息管理的联系
服务器文件系统权限分配
各种数据库时间戳精度
软件开发测试男生礼物
数据库如何查询表
国家网络安全产业园 近期
正版服务器能不开正版验证吗
手机游戏软件开发专业
网络服务器的安全问题
网络安全教育讲座观后感
软件开发的项目答辩PPT
天谕服务器踏浪长帆是哪个区
怎样恢复已删除的重要数据库