rcb007 Posted February 9, 2023 Posted February 9, 2023 I am trying to find how to remove a toolpalettepath with lisp. I have found alot of other examples for adding a toolpalettepath but not removing them. I have an idea to create a routine which would load the custom tool palette, then within that custom tool palette, I want to create a button towards the bottom, which will remove the toolpalettepath. While the removing of that toolpalettepath, all the other tool palettes the user has should still remain in tact. But that is the goal. Thank you for any directions. Quote
Steven P Posted February 9, 2023 Posted February 9, 2023 (command "-toolbar" "properties" "s") Will display toolbars, in this case 'propoerties' - not sure if it will do the same with a custom toolbar, but I like the idea Alternate might be a DCL 'toolbar' that will close itself when you select the command you want if there is no luck with real toolbars (able to be created on the fly and add new commands automatically) Quote
rcb007 Posted February 10, 2023 Author Posted February 10, 2023 After digging into this more. I found out that you can not remove "all" the tool palette paths from the options. If you do, it will automatically set it back to the default path. To get this to "kind of" work, I had to use the following from Ronjons code. With the example below, when the user clicks the button in the ribbon, it would load the tool palette for (path2) by removing (path1), within the tool palette, I have a button towards the bottom which would load (path1) back in and unload the (path2). (defun _addtoolpalettepaths (paths / a b) (setq b (getvar (setq a "*_toolpalettepath"))) (setvar a (strcat b (apply 'strcat (mapcar '(lambda (x) (if (vl-string-search (strcase x) (strcase b)) "" (strcat ";" x) ) ) paths ) ) ) ) ) ;; usage (_addtoolpalettepaths '("c:\\path1" "d:\\path2")) https://www.cadtutor.net/forum/topic/69163-tool-palette-support-path-lisp/ If a user has several toolpatettepaths, can i save all those paths, then unload them, to load (path2), then when they are done with the tool, it would load their several paths back? 1 Quote
rcb007 Posted February 14, 2023 Author Posted February 14, 2023 Sorry for bringing this up, Not sure why I cannot get this command to work. (command "*_toolpalettepath" (strcat "C:\\Users\\" (getvar 'LOGINNAME) "\\autodesk\\toolpalette\\") (chr 59) (strcat "%RoamableRootFolder%\\support\\toolpalette\\")) I get the following error. Unknown command ";". Press F1 for help. Unknown command "ROAMABLEROOTFOLDER\SUPPORT\TOOLPALETTE\". Press F1 for help. nil thank you for any help. Quote
dan20047 Posted February 20, 2023 Posted February 20, 2023 just have one strcat? (command "*_toolpalettepath" (strcat "C:\\Users\\" (getvar 'LOGINNAME) "\\autodesk\\toolpalette\\" (chr 59) "%RoamableRootFolder%\\support\\toolpalette\\")) Quote
Steven P Posted February 21, 2023 Posted February 21, 2023 Looking at this quickly (chr 59) is a ; does that need to be in the middle of a file path? The way you do the command it is read like: (command "*_toolpalettepath" Text1 ; text2), a command with 3 pieces of text after it (count where the brackets start and stop), so Dan20047 has a good point, use just 1 strcat as well Quote
rcb007 Posted February 21, 2023 Author Posted February 21, 2023 Thank you guys for sharing. Noted. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.