Jump to content

Removing Toolpalettepaths


rcb007

Recommended Posts

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.

 

Link to comment
Share on other sites

 

(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)

Link to comment
Share on other sites

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?

 

  • Like 1
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

just have one strcat?

(command "*_toolpalettepath" (strcat "C:\\Users\\" (getvar 'LOGINNAME) "\\autodesk\\toolpalette\\" (chr 59) "%RoamableRootFolder%\\support\\toolpalette\\"))

 

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...