Switch profile lisp

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am controlling two large sets of toolpalette groups using profiles (ProductA 1 & ProductB 1) for multiple users. I have a button set up to switch between the two profiles, so far so good. I also have a second set to work on in the background for updates (ProductA 2 & ProductB 2), so when i need to roll out the updated palettes i just update the lisp to load the background set of profiles. The problem i'm having is when i swap from ProductA 1 to ProductA 2 the Autocad mechanical shortcut is remembering the default ACADmpp profile or if i set it to ProductA 1 it will remember it.
I have tried setting up a acad.lsp file in the support location to run another lisp saved on the network but i cant get it to work.
Is there a way around this?
This is the acad.lsp i tried-
(setq lisp_path “\\uk\caddata\CAD Share\AutoDesk\mechanical\Tool_Palettes_2016\SUPPORT_2016”) ; sets the path
(if (findfile (strcat lisp_path "init.lsp")) ;If you can find a file called ‘init.lsp’
(load (strcat lisp_path "init.lsp")) ) ;Load the file called ‘init.lsp’
The init.lsp is -
;Load Visual Lisp
(vl-load-com)
;Import the admin (PRODUCTA 1 or PRODUCTA 2) Profile from the network
(vl-catch-all-apply 'vla-importprofile (list
(vla-get-profiles (vla-get-preferences (vlax-get-acad-object)))
"PRODUCTA 1"
"\\uk\caddata\CAD Share\AutoDesk\mechanical\Tool_Palettes_2016\SUPPORT_2016\USER PROFILES\PRODUCTA\PRODUCTA 1"
1)
)
;Set "PRODUCTA 1 or PRODUCTA 2" Profile current
(vla-put-ActiveProfile (vla-get-Profiles (vla-get-Preferences (vlax-get-acad-object)))"PRODUCTA 1")
;Set the "modemacro" sysvar to report the latest profile
(SETVAR "modemacro"(STRCAT "PROFILE: $(getvar, cprofile)"))
Thanks
Danny