Support Path

BobBuilder

Usenet Archive
Joined
Aug 6, 2003
Messages
23
Reaction score
0
Hi,

I got this off http://code.acadx.com anyone know where i actually put my support path?

(defun addSupportPath (dir pos / tmp c lst)
(setq tmp ""
c -1
)
(if
(not
(member (strcase dir)
(setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ)
)

Cheers

Bob T.
 
Bob,

Not sure if this is what you mean, but you need to pass 2 arguments to the routine.

dir - your folder to add
pos - the position in the support path, ie:

(addSupportPath "YourFolderName" 1)

I think passing nil to pos will add the path to the end of the support path

Steve
 
so i would do:-
(defun addSupportPath ("C:\Path\mynewpath 1"/ tmp c lst) (setq tmp "" c -1 ) (if (not (member (strcase dir) (setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ)
)

Is this right or am i talking crap!!
 
Bob,

You don't add the arguments directly to the routine, you pass them to it.
Use;

(addSupportPath "C:\Path\mynewpath" 1)

Steve
 
Sorry mate a bit new at this....

Ive created a lisp file called addsupportpath.lsp and added (addSupportPath "C:\Path\mynewpath" 1) to my acad.lsp file.

Is this right cos i get ; error: no function definition: ADDSUPPORTPATH
 
Try
(load "addSupportPath")

in the line before.

Bill
 
the addsupportpath lisp has to be loaded before you can use it.

(load "addsupportpath.lsp")

(addSupportPath "c:\\myFolder" 2)

My question is:
How do you make an "IF" statement so that if the path already exists, to not add the support path?
 
I don't think so.

In my support paths i have the following:

L:\library\CAD\Autodesk\2000i\gen\menu\CADTOOL2

(addSupportPath "L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2" 5)

using the lisp. I get the following in my support paths under the CADTOOL2 reference.

"Llibrarycadautodesk[some fancy pound sign]genmenucadtool2"
 
Use double slashes instead. \\ or /

The real JD said:
I don't think so.

In my support paths i have the following:

L:\library\CAD\Autodesk\2000i\gen\menu\CADTOOL2

(addSupportPath "L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2" 5)

using the lisp. I get the following in my support paths under the CADTOOL2 reference.

"Llibrarycadautodesk[some fancy pound sign]genmenucadtool2"

Jason Piercey said:
Doesn't the code already account for that?
to
 
I now have two paths listed in my support directory:

L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2
L:/LIBRARY/CAD/AUTODESK/2000I/GEN/MENU/CADTOOL2

Jimmy Bergmark said:
Use double slashes instead. \\ or /

The real JD said:
I don't think so.

In my support paths i have the following:

L:\library\CAD\Autodesk\2000i\gen\menu\CADTOOL2

(addSupportPath "L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2" 5)

using the lisp. I get the following in my support paths under the CADTOOL2 reference.

"Llibrarycadautodesk[some fancy pound sign]genmenucadtool2"

Jason Piercey said:
Doesn't the code already account for that?
exists,
 
Oh the double slashes worked!
And I guess it does have checking!
I only see one instance.
THx

The real JD said:
I now have two paths listed in my support directory:

L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2
L:/LIBRARY/CAD/AUTODESK/2000I/GEN/MENU/CADTOOL2

Jimmy Bergmark said:
Use double slashes instead. \\ or /

The real JD said:
I don't think so.

In my support paths i have the following:

L:\library\CAD\Autodesk\2000i\gen\menu\CADTOOL2

(addSupportPath "L:\LIBRARY\CAD\AUTODESK\2000I\GEN\MENU\CADTOOL2" 5)

using the lisp. I get the following in my support paths under the CADTOOL2 reference.

"Llibrarycadautodesk[some fancy pound sign]genmenucadtool2"

Doesn't the code already account for that?
exists,
to
not
add the support path?
 
still not working and its doing my nut!!!

if i create a file call ed addsupportpath.lsp which contains:-

(defun addSupportPath (dir pos / tmp c lst)
(setq tmp ""
c -1
)
(if
(not
(member (strcase dir)
(setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ)
)

Then i add:-

(load "addsupportpath.lsp")
(addSupportPath "c:\\myFolder" 2)

.........to the end of my acad.lsp file, should it work or am i totally going wrong!!!
 
I would try it at the beggining of my .mnl file.
The menus that load in the acad.lsp may be overriding the new settings. Also delete the old .mnc and .mnr files of any menus loaded at startup.

Bill
 
(load "addsupportpath.lsp")
(C:addSupportPath "c:\\myFolder" 2);needs C: for call to outside lisp file

BobBuilder said:
still not working and its doing my nut!!!

if i create a file call ed addsupportpath.lsp which contains:-

(defun addSupportPath (dir pos / tmp c lst)
(setq tmp ""
c -1
)
(if
(not
(member (strcase dir)
(setq lst (mapcar 'strcase (strParse (getenv "ACAD") ";"))) ) ) (progn (if (not pos) (setq tmp (strcat (getenv "ACAD") ";" dir)) (mapcar '(lambda (x) (setq tmp (if (= (setq c (1+ c)) pos) (strcat tmp ";" dir ";" x) (strcat tmp ";" x) ) ) ) lst ) ) (setenv "ACAD" tmp) ) ) (princ)
)

Then i add:-

(load "addsupportpath.lsp")
(addSupportPath "c:\\myFolder" 2)

........to the end of my acad.lsp file, should it work or am i totally
going wrong!!!
 
i get :-

; error: no function definition: C:ADDSUPPORTPATH

any ideas?
 
My bad.
If it's not called C:addsupportpath in the lisp file then you don't need C:
to call it.

Do you get this error when you first start AutoCAD?
You may need to go to.
Assist/Options/System.......and CHECK "load acad.lsp with every drawing"
 

Latest threads

Back
Top