Author Topic: change the order of the paths in the support file search path  (Read 1201 times)

0 Members and 1 Guest are viewing this topic.

domenicomaria

  • Swamp Rat
  • Posts: 723
change the order of the paths in the support file search path
« on: August 31, 2022, 09:11:25 AM »
is it possible via LISP to change the order of the paths in the support file search path?

Tharwat

  • Swamp Rat
  • Posts: 707
  • Hypersensitive
Re: change the order of the paths in the support file search path
« Reply #1 on: August 31, 2022, 10:01:04 AM »
Yes it is possible, but what's the benefit of that new sorting / order since paths will be the same ?

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: change the order of the paths in the support file search path
« Reply #2 on: August 31, 2022, 10:33:07 AM »
I suppose that the files found in the folders at the top are found first ...
...
and if there are two files with the same name, the one in the topmost folder is found first

Lonnie

  • Newt
  • Posts: 169
Re: change the order of the paths in the support file search path
« Reply #3 on: August 31, 2022, 11:07:06 AM »
Try something like this.

(vla-put-supportpath
   (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
   (strcat
   "\\\\1\\designdata\\cadd\\dc acad\\default\\general\\support\\2021 lsp;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\general\\support\\;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\general\\symbols;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\general\\fonts;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\mech;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\mech\\support;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\elec\\support\\symbols;"
   "\\\\1\\designdata\\cadd\\dc acad\\default\\elec\\anno\\job setup;"
   (getenv "appdata")"\\Autodesk\\AutoCAD 2021\\R24.0\\enu\\support;"
   "C:\\program files\\autodesk\\autocad 2021\\support;"
   "C:\\program files\\autodesk\\autocad 2021\\support\\en-us;"
   "C:\\program files\\autodesk\\autocad 2021\\fonts;"
   "C:\\program files\\autodesk\\autocad 2021\\help;"
   "C:\\program files\\autodesk\\autocad 2021\\express;"
   "C:\\program files\\autodesk\\autocad 2021\\support\\color;"
   "C:\\program files (x86)\\autodesk\\applicationplugins\\autodesk appmanager.bundle\\contents\\resources;"
   "C:\\program files (x86)\\autodesk\\applicationplugins\\autodesk appmanager.bundle\\contents\\windows\\2021;"
   "C:\\program files (x86)\\autodesk\\applicationplugins\\autodesk featuredapps.bundle\\contents\\resources;"
   "C:\\program files (x86)\\autodesk\\applicationplugins\\autodesk featuredapps.bundle\\contents\\windows\\2021\\win64;"
   )
)


Yes it is possible, but what's the benefit of that new sorting / order since paths will be the same ?


First one wins in a search. I let my people add a personal folder up top create custom things like pgp and lsp routines. I also give them the option of using a personal lisp routine via a workspace for things they want that are not company policy.


« Last Edit: August 31, 2022, 11:39:24 AM by Lonnie »

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: change the order of the paths in the support file search path
« Reply #4 on: August 31, 2022, 01:02:23 PM »
You can use this function to insert a support path at a specific position in the list.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: change the order of the paths in the support file search path
« Reply #5 on: August 31, 2022, 01:26:35 PM »
You can use this function to insert a support path at a specific position in the list.

I can't test your feature right now,
but I'm sure, as always,
it will be perfect ...
... thank you very much

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: change the order of the paths in the support file search path
« Reply #6 on: September 01, 2022, 05:12:44 AM »
You can use this function to insert a support path at a specific position in the list.

I tested your function, and it works perfectly, of course . . .

Thanks again

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: change the order of the paths in the support file search path
« Reply #7 on: September 01, 2022, 12:28:04 PM »
You're welcome maria, I'm glad it helps.

domenicomaria

  • Swamp Rat
  • Posts: 723
Re: change the order of the paths in the support file search path
« Reply #8 on: September 01, 2022, 02:01:57 PM »
You're welcome maria, I'm glad it helps.
:no:
:laugh:

My first name is Domenico
I am male
Maria is my second name and is a woman's name !

Lee Mac

  • Seagull
  • Posts: 12906
  • London, England
Re: change the order of the paths in the support file search path
« Reply #9 on: September 01, 2022, 04:57:21 PM »
Oops! :uglystupid2:

BIGAL

  • Swamp Rat
  • Posts: 1396
  • 40 + years of using Autocad
Re: change the order of the paths in the support file search path
« Reply #10 on: September 01, 2022, 09:17:42 PM »
A couple of other ideas,

Lee pretty sure you have the dcl with 2 lists you select from the left and it adds to the right box hence new list order then would update paths.

Export paths to a file, reorder then just read back in as code.

As I write code for external clients have to make  sure when testing that their directory is always 1st, in case I have done a mod on some library routines.

A quick and dirty would just drag and drop lsp etc not really a end user program.

Code: [Select]
; thanks to Lee-mac for this defun
; www.lee-mac.com
; 44 is comma 32 is space . is 46 ; is 59
(defun _csv->lst ( strtxt / pos )
(if (setq pos (vl-string-position 59 strtxt))
(cons (substr strtxt 1 pos) (_csv->lst (substr strtxt (+ pos 2))))
(list strtxt)
    )
)


(setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))
(setq paths (vla-get-SupportPath *files*))
(setq lstpaths (_csv->lst59 paths))
(setq fo (open "D:\\acadtemp\\paths.txt" "W"))
(write-line "(setq *files*  (vla-get-files  (vla-get-preferences (vlax-get-Acad-object))))" fo)
(write-line "(vla-put-SupportPath *files* (strcat " fo)
(foreach path lstpaths
(write-line (strcat " \"" path ";\"") fo)
)
(write-line "))" fo)
(close fo)
(alert "Edit using Notepad then just copy and paste to command line")
(startapp "NOTEPAD" "D:\\acadtemp\\paths.txt")

« Last Edit: September 01, 2022, 09:57:53 PM by BIGAL »
A man who never made a mistake never made anything