Hey guys
I have a simple lisp routine that loads everytime one of my users opens a new drawing, It sets the printer paths, sets the template paths and sets a bunch of environment variables
One thing I would like to add to this lisp routine is the ability to add support file search paths.
Is there a simple setenv variable for this? or is it more complicated?
any advice is appreciated.
Thanks!
Chris
Also worthy of note for those using 2012+ when manipulating SFSP, the Autoloader mechanism adds all app-dependent SupportPaths prior to Acad.lsp, and AcadDoc.lsp being loaded in the startup sequence.
It is important to ensure that any path containing \ApplicationPlugins\ NOT be removed from SFSP, as this may cause SupportPath-dependent Autoloader apps to stop working properly.
Cheers
"How we think determines what we do, and what we do determines what we get."
Here is how I've been doing it for many years:
(DEFUN AddSupportPath (dir / tmp Cpath) (VL-LOAD-COM) (SETQ Cpath (GETENV "ACAD") tmp (STRCAT ";" dir ";")) (IF (NOT (VL-STRING-SEARCH dir cpath)) (SETENV "ACAD" (STRCAT Cpath ";" dir))) (PRINC) ) (AddSupportPath "C:\\Symbols") (AddSupportPath "C:\\Drawings") (AddSupportPath "C:\\Lisps")
Not as awesome as Lee's but it has not let me down ever.
Hi Shawn,
The key point is that the function will need to be defined before the function call is evaluated - that is, the defun expression will need to be evaluated before the call to the function is evaluated.
I would suggest copying the code for my Add Support Paths Function into its own .lsp file, and then, on a new line following the code (in the same file), place the function call, i.e. something like:
(LM:sfsp+ '("C:\\Folder1" "C:\\Folder2" "C:\\Folder3"))
You can then load this .lsp file from the acad.lsp, and the function will be defined & evaluated.
Lee
I'm wondering what advantages this has opposed to setting a profile and workspace? Now that would be too simple...?
I am looking for something similar, but I run on LT and profiles (or lisp for that matter) are not supported. Have you looked into changing the system registry keys?
Sorry for bumping an old thead but I'm in the process of getting ready for our upgrade and have wanted to implement something like this for quite a while. Our network hiccups and we lose the paths. I also have certain users changing the pathing on their own and I'd like to stop that if possible.
1. Is it better to put custom paths before the default SFSP, or after? Would this make any difference for performance or load times?
2. Is there a quick way to reset the SFSP back to the Autodesk default? This is so I can quickly reset to default to remove user customizations and add the company standard paths?
3. Is there anyway to lock the the SFSP? This is to prevent my users "accidentally" changing them.
Thanks,
Excuse the resurrection of an old thread but I believe this to be the earliest and best on this topic and am asking @Lee_Mac for direction on how to pass a variable into the function call?
I'm trying to pass (LM:sfsp+n '("$Dir1" "$Dir2" "$Dir3" "$Dir4") 0) and have tried all manner of formatting that I can think of.
For this example assume the following:
(setq $Dir1 "C:\\ACC\\ACCDocs\\XYZ\\XYZ_ACAD Support\\_C3D\\2024\\"))
(setq $Dir2 "G:\\XYZ_ACAD Support\\_C3D\\2024\\")
(setq $Dir3 "C:\\ProjectWise\\XYZ\\C3D\\2024\\")
(setq $Dir4 "C:\\ACAD\\XYZ_ACAD Support\\_C3D\\2024\\")
Thanks in advance!
Easy just make a string the paths are seperated by a semi colon ;
";C:\\ACC\\ACCDocs\\XYZ\\XYZ_ACAD Support\\_C3D\\2024\\;G:\\XYZ_ACAD Support\\_C3D\\2024\\;C:\\ProjectWise\\XYZ\\C3D\\2024\\;C:\\ACAD\\XYZ_ACAD Support\\_C3D\\2024\\"
;make new support paths exist + new
(setq paths (vla-get-SupportPath *files*))
(setq XXXXpaths "L:\\autodesk\\supportfiles;L:\\autodesk\\lisp;L:\\autodesk\\fonts;")
(setq newpath (strcat XXXXpaths paths))
(vla-put-SupportPath *files* newpath)
Thanks @Lee_Mac , do you know if this works on Sharepoint as each individuals folder path has their name in it? Would I have to strcat the name to input their name in the correct place?
Something like this;
(LM:sfsp+ '("C:\\Users\\NAME\\OneDrive - Property\\Standards\\00_CAD Standards\\Lisp Routines"))
I can't seem to get it work even if I use my filepath. Any ideas? and thank you 🙂
Thanks @Lee_Mac , do you know if this works on Sharepoint as each individuals folder path has their name in it? Would I have to strcat the name to input their name in the correct place?
Something like this;
(LM:sfsp+ '("C:\\Users\\NAME\\OneDrive - Property\\Standards\\CAD Standards\\Lisp Routines"))
I can't seem to get it work even if I use my filepath. Any ideas? thank you
You can get (getenv "username") and it is different for different users, so can then match that to the server name, by comparing in a list. used this for printing in a multi Storey building only 1 code but printers on multiple floors.
Hi there, I've created a routine to update the support paths but it something weird has gone on and it looks as if its copied folders!! We are on One Drive so unsure if its the coding or somebody else moving things (everybody says they haven't!).
Would this code download anything or purely update the template support paths within Autocad??
; template path
(vla-put-TemplateDwgPath *files* (strcat "C:\\Users\\" (getvar "username") "\\OneDrive\\Formats and Standards\\00_CAD Standards\\Templates\\_pg_x-ref drawing pack\\"))
; template location
(vla-put-QnewTemplateFile *files* (strcat "C:\\Users\\" (getvar "username") "\\onedrive\\formats and standards\\00_cad standards\\templates\\_pg_x-ref drawing pack\\xxxx-xx-master.dwt"))
Thank you, apologies I'm just fretting 😂
Any help appreciated.
I think it is worth mentioning that this can also be accomplished by setting SFSP in the target of the shortcut, or setting it up in the installation deployment.
My preference is pointing to a shared acad.lsp and acaddoc.lsp on a network drive in the deployment. Control permissions in this path and modify as desired.
Can't find what you're looking for? Ask the community or share your knowledge.