CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

导出方法 (ActiveX)

2023-1-4 10:28| 发布者: admin| 查看: 688| 评论: 0|来自: AutoCAD

摘要: 将 AutoCAD 图形或一组保存的图层设置输出到文件。

将 AutoCAD 图形或一组保存的图层设置输出到文件。

支持的平台:仅窗口

签名 - 文档

工 务 局:

object.Export FileName, Extension, SelectionSet
对象

类型:文档

此方法适用的对象。

文件名

访问:仅输入

类型:字符串

新导出的文件的名称。

外延

访问:仅输入

类型:字符串

此字符串应包含三个字符,用于指定要将图形输出到的文件类型。大小写并不重要。使用以下扩展名之一:.wmf.sat.eps.dxf.bmp

选择集

访问:仅输入

类型:选择集

对于 WMF、SAT 和 BMP 格式,选择集指定要导出的对象。对于 EPS 和 DXF 格式,将忽略选择集并输出整个图形。

签名 - 层状态管理器

工 务 局:

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.

Examples

VBA:

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)
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-19 14:39

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部