将 AutoCAD 图形或一组保存的图层设置输出到文件。 支持的平台:仅窗口 签名 - 文档工 务 局: object.Export FileName, Extension, SelectionSet 签名 - 层状态管理器工 务 局: object.Export Name, FileName
返回值(RetVal)无返回值。 言论输出为 WMF 或 BMP 格式时,选择集将指定图形中要输出的对象。如果提供了空选择集,则提示用户选择对象。提供的 ifis,而不是空的选择集,输出整个图形。Nothing 导出为 SAT 格式时,指定的选择集必须包含一个或多个对象。此选择集指定图形中要输出的对象。仅导出不符合理论对象特征的对象、对象、非流形实体和其他形状管理器实体;选择集中的所有其他对象将被忽略。如果提供了空选择集,则执行该方法时不会出错,并且不会导出任何对象。Region3DSolid3DSolidRegion 输出为 EPS 或 DXF 格式时,将忽略选择集并输出整个图形。 When exporting saved layer settings, you must name your output file with a .las extension in order for AutoCAD to automatically identify it as a saved layer settings export file. ExamplesVBA: Sub Example_Export() ' This example exports the current drawing to DXF format. ' Note that a valid selection set must be provided, even ' though the contents of the selection set are ignored. ' Define the name for the exported file Dim exportFile As String exportFile = "C:\AutoCAD\DXFExport" ' Adjust path to match your system ' Create an empty selection set Dim sset As AcadSelectionSet Set sset = ThisDrawing.SelectionSets.Add("TEST") ' Export the current drawing to the file specified above. ThisDrawing.Export exportFile, "DXF", sset End Sub Visual LISP: (vl-load-com) (defun c:Example_Export() ;; This example exports the current drawing to DXF format. ;; Note that a valid selection set must be provided, even ;; though the contents of the selection set are ignored. (setq acadObj (vlax-get-acad-object)) (setq doc (vla-get-ActiveDocument acadObj)) ;; Define the name for the exported file (setq exportFile "C:\\AutoCAD\\DXFExport") ;; Adjust path to match your system ;; Create an empty selection set (setq sset (vla-Add (vla-get-SelectionSets doc) "TEST")) (vla-Select sset acSelectionSetAll) ;; Export the current drawing to the file specified above. (vla-Export doc exportFile "DXF" sset) (vla-Delete sset) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:46
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.