Running AutoCAD 2014, SP1.
I recorded an action macro to insert a block that's not in my search path (and I don't want it to be). Before inserting the block, I set TEXTEVAL to 1 and responded to the block name prompt with:
(strcat (getenv "ai_root") "Misc Blocks/Lr_Ell")
where "ai_root" is an environment variable set to "C:\AutoCAD Support\". During recording the action recorder correctly expanded the AutoLISP code to "C:\AutoCAD Support\Misc Blocks/Lr_Ell". I then responded to the insert point, scale and rotation prompts (pausing for user input for insert and rotation), set TEXTEVAL back to 0 and ended the recording. I ended up with the attached Action Tree.
I played back the action macro and everything worked fine. As I want the location of the blodk to be based on the "ai_root" e-var, I edited the action tree and change the text for the block name prompt back to
(strcat (getenv "ai_root") "Misc Blocks/Lr_Ell")
When I tried running the macro again, I got a COMMAND FAILED: -insert error saying it was an invalid block name. So it seems that the recorder correctly evaluates the AutoLISP code while recording, but doesn't evaluate it upon playback, even though TEXTEVAL is set to 1.
I used to just use regular a macro
insert;(strcat (getenv "ai_root") "Misc Blocks/Sr_Ell");\1;1;\
for doing the inserting, but this is now a dynamic block with multiple insertion points and the macro fails when you toggle the CTRL key.
I can't hard code the location to the block which is why I have the e-var. Any ideas ?? Can I do this a different way and not use the Action recorder?
Jim