Thursday, May 25, 2017

Set Autocad Lsp Lisp options files for plotting pen tables and Temp folders vla-put Set paths to C\users\username

 Set paths to C\users\username (STRCAT "C:\\Users\\" (getvar "loginname") "\\OneDrive\\PATH"))

;START LSP
;;; Lisp to add paths
(vl-load-com)
; This sets a reference to the install path of your product
(setq acadloc
   (vl-registry-read
      (strcat "HKEY_LOCAL_MACHINE\\" (vlax-product-key))
   "ACADLOCATION")
); This sets a reference to the files portion of the acad preferences

(setq *files* (vla-get-files
   (vla-get-preferences (vlax-get-acad-object))
)) 

; Paths to set Options > Files >
;Printer file support path...
(vla-put-PrintSpoolerPath *files* "C:\\Temp\\")
(vla-put-PrinterConfigPath *files* "\\\\Server\\printers")
(vla-put-PrinterDescPath *files* "\\\\Server\\printers")
(vla-put-PrinterStyleSheetPath *files* "\\\\Server\\Pen Settings")

;Automatic Save
(vla-put-AutoSavepath *files* "C:\\Temp\\")

;Template settings
(vla-put-TemplateDwgPath *files* "\\\\Server\\Templates\\")
(vla-put-QnewTemplateFile *files* "\\\\Server\\templates\\Template.dwt")

;Log File
(vla-put-LogFilePath *files* "C:\\Temp\\")

;Plot and Publish log
(vla-put-PlotLogFilePath *files* "C:\\Temp\\")

;Temporary Drawing location
(vla-put-TempFilePath *files* "C:\\Temp\\")

;Temporary External Reference
(vla-put-TempXrefPath *files* "C:\\Temp\\")
 
; end use of *files*
(vlax-release-object *files*)
; exit quietly
(princ "Paths set to Server")
 ;END LSP

MORE

 ; 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:\\Temp")

; 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:\\Temp\\")

; template location
;(vla-get-QnewTemplateFile *files*)
(vla-put-QnewTemplateFile *files* "S:\\Autodesk\\c3d Templates\\cxxx.dwt")

;make new support paths exist + new
(setq paths (vla-get-SupportPath *files*))

(setq mypaths
"S:\\autodesk\\supportfiles;
S:\\autodesk\\lisp;
S:\\autodesk\\fonts;
S:\\autodesk\\hfs fonts;"
)

(setq newpath (strcat mypaths paths))
(vla-put-SupportPath *files* newpath)

; Tempdirectory
;(vla-get-TempFilePath *files*))
(vla-put-TempFilePath *files* "C:\\Temp\\")

; template path
;(vla-get-TemplateDwgPath *files*)
(vla-put-TemplateDwgPath *files* "S:\\Autodesk\\c3d Templates")

; xref temp path
;(vla-get-TempXrefPath *files*))
(vla-put-TempXrefPath *files* "C:\\Temp\\")

; end use of *files*
(vlax-release-object *files*)

; exit quietly
(princ "All Done")

No comments: