Dj_T_Rex2002 发表于 2022-7-5 15:01:56

Help with my LISP for Auto-Fil

Ok so I am no expert with LISPs but LOVE learning new stuff. I just worked with this LISP by looking at other peoples LISPs and modified mine like the bottom code. However, I do not know how to set it to fill in the Trusted Locations, Plot Style Table Search Path, AutoSave since I am thinking the (vla-put-...) part might be wrong? I have been trying different VLA paths from the list on a website and cannot make it work. Please help and thank you ahead of time.
 
 

(vl-load-com)(vla-put-supportpath   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))   (strcat      "C:\\Users\\\\AppData\\Roaming\\Autodesk\\AutoCAD 2018\\r22.0\\enu\\support;       C:\\Users\\\\AppData\\Roaming\\Autodesk\\ApplicationPlugins\\AdnPlugin-Screenshot.bundle\\Contents\\Resources;       C:\\Users\\\\AppData\\Roaming\\Autodesk\\ApplicationPlugins;       C:\\Program Files\\Autodesk\\AutoCAD 2018\\Support;       C:\\Program Files\\Autodesk\\AutoCAD 2018\\Express;       C:\\Program Files\\Autodesk\\ApplicationPlugins\\Autodesk AppManager.bundle\\Contents\\Resources;       C:\\Program Files\\Autodesk\\ApplicationPlugins\\Autodesk AppManager.bundle\\Contents\Windows\\2018;       C:\\Program Files\\Autodesk\\ApplicationPlugins\\Autodesk FeaturedApps.bundle\\Contents\\Resources;       C:\\Program Files\\Autodesk\\ApplicationPlugins\\Autodesk FeaturedApps.bundle\\Contents\\Windows\\2018\\Win64;       C:\\Program Files\\Autodesk\\ApplicationPlugins\\coldwater4.bundle;       C:\\Program Files (x86)\\Autodesk\\ApplicationPlugins\\Autodesk AppManager.bundle\\Contents\\Resources;       C:\\Program Files (x86)\\Autodesk\\ApplicationPlugins\\Autodesk AppManager.bundle\\Contents\\Windows\\2018;       C:\\Program Files (x86)\\Autodesk\\ApplicationPlugins\\Autodesk FeaturedApps.bundle\\Contents\\Resources;       C:\\Program Files (x86)\\Autodesk\\ApplicationPlugins\\Autodesk FeaturedApps.bundle\\Contents\\Windows\\2018\\Win64;       C:\\Program Files (x86)\\autodesk\\ApplicationPlugins\\ColdWater4.bundle;       J:\\Active Projects\\Detailers\\\\Misc\\LISPS;       J:\\Active Projects\\Detailers\\\\Misc\\LISPS\\STL Goes in the Support Folder;"   ));; For Trusted Locations(vl-load-com)(vla-put-PrinterConfigPath   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))   (strcat      "X:\\Drawing Utilities\\Plot Styles;"   ));; for Plot Style Table Search Path;; for AutoSave(vl-load-com)(vla-put-QNewTemplateFile   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))   (strcat      "E:\\engaccess\\start 36.dwt;"   ))

ronjonp 发表于 2022-7-5 15:44:19

Use vla-put-PrinterStyleSheetPath for your plot style path. You also might want to append to the support paths rather than completely overwriting them.
 
This will show you the options available:

(vlax-dump-object (vla-get-files (vla-get-preferences (vlax-get-acad-object))) t)
 
You can also set the support paths like so:

(setenv "ACAD" (strcat (getenv "ACAD") ";C:\\"))

BIGAL 发表于 2022-7-5 16:12:04

Have a look at this should have all you want includes trusted paths and menus.
 

; resets the paths usefull for update versions of Autocad; by A H 2011; This sets a reference to the install path of your product; the gets are their for info maybe other use; use this to find other settings ;(vlax-dump-object (vla-get-files (vla-get-preferences (vlax-get-Acad-object))) T)(vl-load-com)(defun setpaths ( / *files* doc) ; make temp directory(if (vl-file-directory-p "C:\\Acadtemp\\")(Princ "Acadtemp exists")(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* "P:\\Autodesk\\ICONS"); custom menu;(vla-get-Menufile *files*));(vla-put-Menufile*files* "C:\\Users\\2013XXXX"); printers config;(vla-get-PrinterConfigPath *files*)(vla-put-PrinterConfigPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles 2011"); printers style sheet;(vla-get-PrinterStyleSheetPath *files*)(vla-put-PrinterStyleSheetPath *files* "P:\\AutoDESK\\Plotting\\Plot Styles"); printer drv's;(vla-get-PrinterDescPath *files*)(vla-put-PrinterDescPath *files* "P:\\AutoDESK\\Plotting\\Drv"); print spooler;(vla-get-PrintSpoolerPath *files*)(vla-put-PrintSpoolerPath *files* "C:\\AcadTemp\\"); templatepath;(vla-get-TemplateDwgPath *files*)(vla-put-TemplateDwgPath *files* "P:\\Autodesk\\c3d Templates"); template location;(vla-get-QnewTemplateFile *files*)(vla-put-QnewTemplateFile *files* "P:\\Autodesk\\c3d Templates\\XXXX-2019.dwt");make new support paths exist + new(setq paths (vla-get-SupportPath *files*))(setq XXXXpaths "P:\\autodesk\\supportfiles;P:\\autodesk\\lisp;P:\\autodesk\\fonts;P:\\autodesk\\hfs fonts;")(setq newpath (strcat XXXXpaths paths))(vla-put-SupportPath *files* newpath); Tempdirectory ;(vla-get-TempFilePath *files*))(vla-put-TempFilePath *files* "C:\\AcadTemp\\");   PlotLogFilePath = "C:\\Documents and Settings\\BIGAL.XXXX-AD\\localsettings\\application data\\autodesk\\c3d 2011\\enu\\"(vla-put-PlotLogFilePath *files* "C:\\AcadTemp\\");   LogFilePath = "C:\\Documents and Settings\\BIGAL.XXXX-AD\\localsettings\\application data\\autodesk\\c3d 2011\\enu\\"(vla-put-LogFilePath *files* "C:\\AcadTemp\\"); xref temp path;(vla-get-TempXrefPath *files*))(vla-put-TempXrefPath *files* "C:\\AcadTemp\\"); end use of *files*(setq oldtrust (getvar 'trustedpaths))(setq newtrust (strcat oldtrust ";" "p:\\Autodesk..."))(setvar 'trustedpaths newtrust)(command "menuload" "p:\\autodesk\\hfs Fonts\\hfs-XXXX")(menucmd "P19=+HFS.POP1")(command "menuload" "p:\\autodesk\\lisp\\surfal")(menucmd "P20=+SURFAL.POP1")(command "menuload" "p:\\autodesk\\lisp\\XXXXSTDS9")(menucmd "P21=+XXXXSTDS.POP1")(command "menuload" "p:\\autodesk\\lisp\\XXXX2011")(menucmd "P22=+XXXX2011.POP1")) ; defun(setpaths)(alert "Run user script for toolbars"); exit quitely(princ "All Done")
页: [1]
查看完整版本: Help with my LISP for Auto-Fil