Mulitple insert macro

Discussion in 'AutoCAD' started by shortems, Jul 27, 2004.

  1. shortems

    shortems Guest

    I am attempting to insert two blocks with the same insertion point using the same scale factor using one macro. I have been successful in doing this using diesel and only in Autocad LT. I am trying to create a similar macro for a full version of Autocad 2004 and 2005. Here is the macro I have for the LT version.

    ^c^c$m=setenv;scale;\-insert;elemark.dwg;\"$m=$(getenv,scale)";;\;;-insert;elemark-att.dwg;@;"$m=$(getenv,scale)";;0;

    I have attempted to create this command but I am unsure if this is set up correctly. Here is the command for the full version.

    ^C^C(setenv"scale""\");$m=-INSERT;"ele-mark.DWG";\"$m=$(getenv,scale)";\$m=-INSERT;"elemark-att.DWG";@;"$m=$(getenv,scale)";0;

    any suggestions are greatly appreciated.
     
    shortems, Jul 27, 2004
    #1
  2. shortems

    ECCAD Guest

    Change:
    C^C(setenv"scale""\");$m=-INSERT;"ele-mark.DWG";\"$m=$(getenv, scale)";\$m=-INSERT;"elemark-att.DWG";@;"$m=$(getenv,scale)";0;
    To:
    ^c^c(command "-insert" "ele-mark" pause (getvar "dimscale") "" "")(setq pt (getvar "lastpoint"))(command "-insert" "elelmark-att" pt (getvar "dimscale") "" "")

    Watch for word wrap..

    Bob
     
    ECCAD, Jul 27, 2004
    #2
  3. shortems

    shortems Guest

    I am unable to use the (getvar "dimscale"). I would like the user to be able to input the scale for the first inserted block and use that scale from the first block for the scale of the second block. I wouldnt mind setting the scale prior to the insert command. and have it look something like this.

    ^C^C(setq scale "#")( command "-insert" "ele-mark" pause scale "" pause)(setq pt (getvar "lastpoint"))(command "-insert" "ele-mark-att" pt scale "" "")

    Where the # in the first setq string is input by the user. any suggestions?
     
    shortems, Jul 27, 2004
    #3
  4. shortems

    ECCAD Guest

    Modified:
    ^C^C(setq scale (getreal "\nScale Factor"))(command "-insert" "ele-mark" pause scale "" pause)(setq pt (getvar "lastpoint"))(command "-insert" "ele-mark-att" pt scale "" "")

    Bob
     
    ECCAD, Jul 27, 2004
    #4
  5. No need to save "pt" --

    ^C^C(setq scale (getreal "\nScale Factor"))(command "-insert" "ele-mark"
    pause scale "" pause)(command "-insert" "ele-mark-att" (getvar "lastpoint")
    scale "" "")

    Kent Cooper, AIA


    pause scale "" pause)(setq pt (getvar "lastpoint"))(command "-insert"
    "ele-mark-att" pt scale "" "")
     
    Kent Cooper, AIA, Jul 27, 2004
    #5
  6. shortems

    shortems Guest

    that works great

    thanks
     
    shortems, Jul 27, 2004
    #6
  7. shortems

    ECCAD Guest

    Kent,
    Yes, is a little shorter..
    :)
    Bob
     
    ECCAD, Jul 27, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.