Save 方法 (ActiveX)
保存一个文档或一组图层属性设置;菜单组不再受支持。 支持的平台:仅限 Windows 签名 - LayerStateManager(仅限 AutoCAD for Windows)VBA: object.Save Name, Mask
签名 - MenuGroupVBA: object.Save MenuFileType 返回值 (RetVal)无返回值。 言论文档:将文档保存到安全 URL 时,会出现一个对话框,提示用户输入必要的密码信息。 菜单组:此方法对 AutoCAD 2006 或更高版本中的菜单组无效。在将来的版本中,此方法将从对象中删除。MenuGroup 例子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 可视化 LISP: (vl-load-com) (defun c:Example_Save() ;; The following example saves current drawing (setq acadObj (vlax-get-acad-object) 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) 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)) ) |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 11:40
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.