lisp to set tool pallete paths

lisp to set tool pallete paths

Anonymous
Not applicable
2,046 Views
4 Replies
Message 1 of 5

lisp to set tool pallete paths

Anonymous
Not applicable

I am trying to make a lisp that will set tool palette paths and use it easily for multiple computers.

 

I tried to follow the following post from 2007 with no luck... I get the error "error: malformed list on input"

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/tool-palette-path-lisp/m-p/2014485/h...

 

This is what I have so far:

 

;;TOOLPATHTRANS-acad.LSP - (c)
;;
;; Sets path for tool palettes
;; displays the result in an AutoCAD Alert Window.
;;
(defun C:TLP1 ()
(command
"*_TOOLPALETTEPATH"
"S:/Office/Transportation/CAD Standards/ERI CAD Standards/Templates/Tool Palettes/Build (Write)")
)

(defun C:TLP2 ()
(vla-put-ToolPalettePath (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))) (strcat (getvar "ROAMABLEROOTPREFIX") "Support/ToolPalette"))

 

We are using civil 3d. so we need a path to our network for shared acad items and a path to the default location for the Civil 3d assemblies.

Some users only use acad so they would only need the path to the shared location.

 

Thank you,

-John

0 Likes
2,047 Views
4 Replies
Replies (4)
Message 2 of 5

DannyNL
Advisor
Advisor

I'm not a happy customer if people within my company are using special characters in file and/or path names.

Sometimes unfortunately there is no escape from it.

 

There are ( ) in your path name and these are special characters in LISP. If needed in text you need to prefix them with a \ so the interpreter wil know it's not the end/beginning of a statement but just text.

 

"S:/Office/Transportation/CAD Standards/ERI CAD Standards/Templates/Tool Palettes/Build \(Write\)")
0 Likes
Message 3 of 5

Anonymous
Not applicable

Hi,

I think you renamed the original function "C:TLP3" into "C:TLP2" and did some misstyping - missed closing ")". Look at your referenced link and it shoud work 😉

 

Regards,

peter

0 Likes
Message 4 of 5

Anonymous
Not applicable

I am getting this message and the path is not changing.

 

(LOAD "S:/Office/Transportation/CAD Standards/ERI CAD Standards/Templates/Tool Palettes/TOOLPATHTRANS-acad.lsp") ; error: malformed list on input

 

I renamed the folder to not have ().

 

 

;;TOOLPATHTRANS-acad.LSP - (c)
;;
;; Sets path for tool palettes
;; displays the result in an AutoCAD Alert Window.
;;
(defun C:TLP1 ()
(command
"*_TOOLPALETTEPATH"
"S:/Office/Transportation/CAD Standards/ERI CAD Standards/Templates/Tool Palettes/Deploy Read-Only")
)
(defun C:TLP2 ()
(vla-put-ToolPalettePath (vla-get-Files (vla-get-Preferences (vlax-get-acad-object))) (strcat (getvar "ROAMABLEROOTPREFIX") "Support/ToolPalette")
)

 

Thanks-

0 Likes
Message 5 of 5

cadffm
Consultant
Consultant
And where is the closing/right bracket for closing your defun: (defun C:TLP2
Add one more ) at the end.

Lee_Mac had a good answer posted for that issue.
https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/malformed-list-on-input/td-p/4774633

Sebastian

0 Likes