rlx Posted February 24, 2020 Posted February 24, 2020 ;;; as function with path hard coded (defun C:AddToolPalettePath ( / _pimp pFiles CurToolPath NetToolPath) (vl-load-com) (defun _pimp (s) (strcase (vl-string-trim " ;\\" (vl-string-translate "/" "\\" s)))) (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) (setq CurToolPath (_pimp (vla-get-ToolPalettePath pFiles))) (setq NetToolPath (_pimp "I:\\_CAD STANDARDS\\100 - CAD SUPPORT FILES\\200 - SUPPLEMENTARY FILES\\TOOL PALETTES")) (if (not (vl-string-search NetToolPath CurToolPath)) (vla-put-toolPalettePath pFiles (strcat CurToolPath ";" NetToolPath))) (princ) ) ;;; or as subfunction with argument : ;;; (_AddToolPalettePath "I:\\_CAD STANDARDS\\100 - CAD SUPPORT FILES\\200 - SUPPLEMENTARY FILES\\TOOL PALETTES") (defun _AddToolPalettePath ( $tp / _pimp pFiles CurToolPath NetToolPath) (vl-load-com) (defun _pimp (s) (strcase (vl-string-trim " ;\\" (vl-string-translate "/" "\\" s)))) (setq pFiles (vla-get-files (vla-get-preferences (vlax-get-acad-object)))) (setq CurToolPath (_pimp (vla-get-ToolPalettePath pFiles))) (setq NetToolPath (_pimp $tp)) (if (not (vl-string-search NetToolPath CurToolPath)) (vla-put-toolPalettePath pFiles (strcat CurToolPath ";" NetToolPath))) (princ) ) 1 Quote
Sportyyyy Posted February 25, 2020 Posted February 25, 2020 You guys are awesome - thank you for explaining. I spoke to another coder who refreshed my memory on how crappily Autodesk manages toolpalettes (i.e. the groups are stored in the registry via the profile and that a restart is required for changes to take effect). I'd like to find the guys who programmed it this way and backhand them a few times. Anyway, the suggestion I heard from him and have seen floating around online is it to have buttons in toolbar/ribbon to toggle the ToolPalette Path between the User's default and the network Palettes so then this group crap is irrelevant. That's something to tackle for another day though. P.S. the pimp function... Quote
C. Roberts Posted September 20 Posted September 20 Is there a way to to do the same thing to the Authoring Tool Palettes Location? Haven't been able to find where it is located in the vla object acad/preferences/files or as a system variable like the tool palettes location can be updated/changed. 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.