See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Action recorder error when inserting a block

  1. #1
    Member Jim_Fisher's Avatar
    Join Date
    2015-12
    Location
    Texas
    Posts
    31
    Login to Give a bone
    0

    Default Action recorder playback error when inserting a block

    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
    Attached Images Attached Images
    Last edited by Jim_Fisher; 2015-04-07 at 08:59 PM.

  2. #2
    Member
    Join Date
    2009-01
    Posts
    6
    Login to Give a bone
    1

    Default Re: Action recorder error when inserting a block

    AutoLisp in your Action Macro tree wont fly.

    Try something like this with your regular macro. Specify the scale and rotation before specifying the insertion point. In this example (Command "INSERT" "Your_Block_Name" "Scale" 1 "Rotation" 0) I specified the scale and rotation then just dropped out of the macro and was able to cycle through alternative insertion points.

  3. #3
    Member Jim_Fisher's Avatar
    Join Date
    2015-12
    Location
    Texas
    Posts
    31
    Login to Give a bone
    0

    Default Re: Action recorder error when inserting a block

    Thanks for the reply.

    >> AutoLisp in your Action Macro tree wont fly. <<

    Bummer ... that's the problem I was really trying to solve. Hello AutoDesk!!

    Thanks for the suggestion.

    Jim

Similar Threads

  1. What do you use Action Recorder for?
    By mountpelepele in forum AutoCAD Action Recorder
    Replies: 37
    Last Post: 2017-10-10, 09:19 PM
  2. Invoking Action Recorder
    By s_depc in forum AutoLISP
    Replies: 5
    Last Post: 2010-07-23, 10:32 PM
  3. Action Recorder in Block Editor
    By sam.121498 in forum AutoCAD Action Recorder
    Replies: 0
    Last Post: 2008-11-21, 04:54 PM
  4. Action Recorder in Block Editor
    By sam.121498 in forum AutoCAD General
    Replies: 0
    Last Post: 2008-11-19, 04:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •