CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

保存方法 (ActiveX)

2023-1-4 04:03| 发布者: admin| 查看: 732| 评论: 0|来自: AutoCAD

摘要: 保存文档或图层属性设置组;菜单组不再受支持。

保存文档或图层属性设置组;菜单组不再受支持。

支持的平台:仅窗口

签名 - 文档

工 务 局:

object.Save
对象

类型:文档

此方法适用的对象。

签名 - 层状态管理器

工 务 局:

object.Save Name, Mask
对象

类型:层状态管理器

此方法适用的对象。

名字

访问:仅输入

类型:字符串

要分配给已保存图层设置的名称。

面具

访问:仅输入

类型:枚举AcLayerStateMask

表示要保存和恢复的图层属性的数字。使用以下常量标识图层属性:

  • acLsAll:所有图层属性
  • acLsColor:颜色
  • acLsFrozen:冷冻或解冻
  • acLsLineType:线型
  • acLsLineWeight:线宽
  • acLsLocked:锁定或解锁
  • acLsNewViewport:冻结或解冻的新视口图层
  • acLsNone:没有
  • acLsOn:开或关
  • acLsPlot:打印打开或关闭
  • acLsPlotStyle:绘图风格

签名 - 菜单组

工 务 局:

object.Save MenuFileType
对象

类型:菜单组

此方法适用的对象。

菜单文件类型

访问:仅输入

类型:枚举AcMenuFileType

  • acMenuFileCompiled
  • acMenuFileSource

返回值(RetVal)

无返回值。

Remarks

Document: When you save a document to a secure URL, a dialog box prompts the user for the necessary password information.

Menugroup: This method has no effect for menu groups in AutoCAD 2006 or later. This method will be removed from the object in a future release. MenuGroup

Examples

VBA:

Sub Example_Save()
    ' The following example saves current drawing
    
    ThisDrawing.Save
    
End Sub

Sub Example_Save_LayerSettings()
    ' The following code saves the color and linetype settings
    ' of the current layer.

    Dim oLSM As AcadLayerStateManager

    ' Access the LayerStateManager object
    Set oLSM = ThisDrawing.Application. _
       GetInterfaceObject("AutoCAD.AcadLayerStateManager." & Left(AcadApplication.Version, 2))

    ' Associate the current drawing database with LayerStateManager
    oLSM.SetDatabase ThisDrawing.Database
    oLSM.Save "ColorLinetype", acLsColor + acLsLineType

End Sub

Visual LISP:

(defun c:Example_Save()
    ;; The following example saves current drawing
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    (vla-Save doc)
)

(defun c:Example_Save_LayerSettings()
    ;; The following code saves the color and linetype settings
    ;; of the current layer.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))

    ;; Access the LayerStateManager object
    (setq oLSM (vla-GetInterfaceObject acadObj (strcat "AutoCAD.AcadLayerStateManager." (substr (getvar "ACADVER") 1 2))))

    ;; Associate the current drawing database with LayerStateManager
    (vla-SetDatabase oLSM (vla-get-Database doc))

    (vla-Save oLSM "ColorLinetype" (+ acLsColor acLsLineType))
)

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 14:34

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部