'ExportProfile
strName
strFilename
)
T
)
(princ \
)
)
(princ (strcat \ )
)
)
) )
;;25.6 [功能] 输出配置文件
;; NOTES: Export an existing profile to a new external .ARG file
;; 示例: (MJ:ProfileExportX \
(defun MJ:ProfileExportX (pName ARGfile)
(cond
((MJ:ProfileExists-p pName)
(vlax-invoke-method
(MJ:Profiles)
'ExportProfile
pName
ARGfile
(vlax-make-variant 1 :vlax-vbBoolean)
;; == TRUE
)
)
(T (princ \ ) )
;;25.7 [功能] 输入配置文件
;; ARGS: profile-name(string), arg-file(string)
;; 示例: (MJ:ProfileImport \
;; VBA equivalent: ;;
;; ThisDrawing.Application.preferences._ ;;
;; Profiles.ImportProfile _ ;;
;; strProfileToImport, strARGFileSource, True
(defun MJ:ProfileImport (pName ARGfile)
(cond
((findfile ARGfile)
(vlax-invoke-method
;; (vlax-get-property (MJ:AcadPrefs) \
'ImportProfile
pName
ARGfile
(vlax-make-variant 1 :vlax-vbBoolean)
;; == TRUE
)
) ;
(T (princ \
) )
;;25.8 [功能] 复制配置文件
;; 示例: (MJ:ProfileCopy pName newName)
(defun MJ:ProfileCopy (Name1 Name2)
(cond
((and
(MJ:ProfileExists-p Name1)
(not (MJ:ProfileExists-p Name2))
)
(vlax-invoke-method
(MJ:Profiles)
'CopyProfile
Name1
Name2
)
) ;
((not (MJ:ProfileExists-p Name1))
(princ \
) ;
((MJ:ProfileExists-p Name2)
(princ \
) ) )
;;25.9 [功能] 重命名配置文件
;; 示例: (MJ:ProfileRename oldName newName)
(defun MJ:ProfileRename (oldName newName)
(cond
((and
(MJ:ProfileExists-p oldName)
(not (MJ:ProfileExists-p newName))
)
(vlax-invoke-method
(MJ:Profiles)
'RenameProfile
oldName
newName
)
)
(T (princ))
;; add your error handling here? ) )
;;25.10 [功能] 删除配置文件
;; 示例: (MJ:ProfileDelete \
(defun MJ:ProfileDelete (pName)
(vlax-invoke-method
(vlax-get-property (MJ:AcadPrefs) \
'DeleteProfile
pName ) )
;;25.11 [功能] 配置文件是否存在
;; 示例: (if (MJ:ProfileExists-p \
(defun MJ:ProfileExists-p (pName)
(member (strcase pName) (mapcar 'strcase (MJ:ProfileList)))