Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Setting Support File Search Paths in lisp routine

12 REPLIES 12
Reply
Message 1 of 13
chris410fortin
11561 Views, 12 Replies

Setting Support File Search Paths in lisp routine

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

 

12 REPLIES 12
Message 2 of 13
Lee_Mac
in reply to: chris410fortin

Message 3 of 13
BlackBox_
in reply to: chris410fortin

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."

Message 4 of 13
smbrennan
in reply to: Lee_Mac

Lee_Mac

I am trying to utilize your Add & Remove Support File Search Paths - but I am having some difficulty. I haven't programmed in 14 years, and even at that, it was an introduction to C++ - needless to say I'm a bit out of it.

I am trying to run your LM:sfsp+ function via acad.lsp. I copied the entire "Function Description" code into it's own .lsp file. The acad.lsp file contains your "Function Call", and I am defining the folders I wish to add within the call. However, I don't see those folders when I re-open CAD. What am I missing??? I am using MEP 2015.

Thanks,
Shawn
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 5 of 13
mid-awe
in reply to: chris410fortin

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.

Message 6 of 13
smbrennan
in reply to: mid-awe

Thanks Mid-Awe! That does the trick for me. Much easier to understand too! I'm still learning AutoLISP so easier = better (for now).
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 7 of 13
Lee_Mac
in reply to: smbrennan

smbrennan85 wrote:
Lee_Mac

I am trying to utilize your Add & Remove Support File Search Paths - but I am having some difficulty. I haven't programmed in 14 years, and even at that, it was an introduction to C++ - needless to say I'm a bit out of it.

I am trying to run your LM:sfsp+ function via acad.lsp. I copied the entire "Function Description" code into it's own .lsp file. The acad.lsp file contains your "Function Call", and I am defining the folders I wish to add within the call. However, I don't see those folders when I re-open CAD. What am I missing??? I am using MEP 2015.

Thanks,
Shawn

 

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

Message 8 of 13
smbrennan
in reply to: Lee_Mac

Ahh ok. I think my problem was that I was placing the function call in the acad.lsp file itself. I knew something wasn't right with my own logic - but it makes sense now.

Thanks for the prompt reply Lee!
Shawn B.

  ||    
To help improve Autodesk Products, please Click Here to Vote for ideas and submit your own.
Message 9 of 13
Lee_Mac
in reply to: smbrennan

You're welcome Shawn Smiley Happy

Message 10 of 13
m_rogoff
in reply to: chris410fortin

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?

 

Message 11 of 13
DanSingleton
in reply to: Lee_Mac

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,

Message 12 of 13

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!

Message 13 of 13
Sea-Haven
in reply to: chris410fortin

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)

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost