Windows Environment Variables in Macros

We came up with multiple sets of tool palettes, and set up macros on a ribbon panel to switch between those palette sets.  Those work fine as the macros point to a static path that all users will have on their PC.  I also would like to include a macro to point the path back to the default tool palettes, but it seems that the command does not recognize the Windows Environment variable and just creates a new tool palette folder in the Support directory.  Does BricsCAD support these variables in macros, or am i formatting it incorrectly?  Here are the examples.

This works perfectly to switch to the first set of tool palettes:

[code]c^c^_toolpalettepath;C:/BricsCADTools//ToolPalettes/ToolPalette1;[/code]

This doesn't seem to recognize the Windows Environment Variable:

[code]c^c^_toolpalettepath;%appdata%/Bricsys/BricsCAD/V16x64/en_US/Support/ToolPalettes;[/code]

Comments

  • You can use LISP to retrieve windows environment variables.
    [code]c^c^_toolpalettepath;(strcat (getenv "APPDATA") "\\Bricsys\\BricsCAD\\V16x64\\en_US\\Support\\ToolPalettes");[/code]

    In this case you are probably better to use ROAMABLEROOTPREFIX instead
    [code]c^c^_toolpalettepath;(strcat (getvar "ROAMABLEROOTPREFIX") "Support\\ToolPalettes");[/code]

    You could also wrap the whole thing in a setvar
    [code]c^c^(setvar "TOOLPALETTEPATH" (strcat (getvar "ROAMABLEROOTPREFIX") "Support\\ToolPalettes"));[/code]

    Regards,
    Jason Bourhill

This discussion has been closed.