BIGAL 发表于 2022-7-6 08:46:50

我们在制作新框时使用它,但您可以轻松地添加if语句等
 
; This sets a reference to the install path of your product
; the gets are their for info maybe other use
(vl-load-com)
; make temp directory
;(vl-mkdir "c:\\ACADTEMP")
(setq *files*(vla-get-files(vla-get-preferences (vlax-get-acad-object))))
; savepath
;(vla-get-AutoSavepath *files*)
(vla-put-AutoSavepath *files* "C:\\ACADTemp")
; custom icons
;(vla-get-CustomIconPath *files*))
(vla-put-CustomIconPath *files* "S:\\Autodesk\\ICONS")
; printers config
;(vla-get-PrinterConfigPath *files*)
(vla-put-PrinterConfigPath *files* "S:\\AutoDESK\\Plotting\\Plot Styles 2011")
; printers style sheet
;(vla-get-PrinterStyleSheetPath *files*)
(vla-put-PrinterStyleSheetPath *files* "S:\\AutoDESK\\Plotting\\Plot Styles")
; printer drv's
;(vla-get-PrinterDescPath *files*)
(vla-put-PrinterDescPath *files* "S:\\AutoDESK\\Plotting\\Drv")
; print spooler
;(vla-get-PrintSpoolerPath *files*)
(vla-put-PrintSpoolerPath *files* "C:\\ACADTemp\\")
; template location
;(vla-get-QnewTemplateFile *files*)
(vla-put-QnewTemplateFile *files* "S:\\Autodesk\\c3d Templates\\cogg.dwt")
;make new support paths exist + new
(setq paths (vla-get-SupportPath *files*))

(setq mygpaths
"S:\\autodesk\\supportfiles;
S:\\autodesk\\lisp;
S:\\autodesk\\fonts;
S:\\autodesk\\hfs fonts;"
)
(setq newpath (strcat mygpaths paths))
(vla-put-SupportPath *files* newpath)
; Tempdirectory
;(vla-get-TempFilePath *files*))
(vla-put-TempFilePath *files* "C:\\ACADTemp\\")
; templatepath
;(vla-get-TemplateDwgPath *files*)
(vla-put-TemplateDwgPath *files* "S:\\Autodesk\\c3d Templates")
; xref temp path
;(vla-get-TempXrefPath *files*))
(vla-put-TempXrefPath *files* "C:\\ACADTemp\\")
; end use of *files*
(vlax-release-object *files*)
; exit quitely
(princ "All Done")

monk 发表于 2022-7-6 08:52:04

看起来很不错。我认为我们通过不同的方式实现了相同的目标。我主要关注远程管理,并通过日志文件创建者获得反馈。谢谢

BIGAL 发表于 2022-7-6 08:55:42

不确定您是否知道,但您可以从Autocad中获取登录名(GETENV“username”),您可以执行一个批处理文件来检查用户名,然后复制正确的配置文件。启动Autocad时,您可以编辑Autocad桌面图标中的命令行。

Lee Mac 发表于 2022-7-6 08:59:18

 
而且
(getvar 'LOGINNAME)

monk 发表于 2022-7-6 09:01:14

我用这个:
(getvar "LOGINNAME")
 
>>'
(getvar 'LOGINNAME)

Lee Mac 发表于 2022-7-6 09:05:51

在LISP中,撇号的意思是“不要计算该表达式”,因此任何前面带有撇号的表达式都按面值取值。
 
现在看一下getvar函数的文档(同样适用于setvar):
 

monk 发表于 2022-7-6 09:07:36

太棒了我明白

Lee Mac 发表于 2022-7-6 09:10:44

好东西
页: 1 [2]
查看完整版本: 列表中的IF语句