Results 1 to 4 of 4

Thread: call script within macro & nested macro

  1. #1
    Member
    Join Date
    2007-03
    Location
    jakarta,indonesia
    Posts
    21
    Login to Give a bone
    0

    Cool call script within macro & nested macro

    maybe any one here already know how to create macro and also create script, have u try to combine the both? i have, its cool and a great solusion to resolve the limited character space that provide in toolspalettes menu, but not the amount of character limitation,I 've created a script within a macro, but there's not the reason using a script to manipulate the amount of character, becos when the menu executed , both the macro character and the script still evaluated by lt, and when those character exceed the limits, the macro terminated (yes it is, the macro has a limits in character amount, approx to 2200 character, maybe.. i dunno the exact number...i use acadlt2008, i dunno is there a limits or no in full acad ),so i use the script just to make easier when it needs to edit or modify in future, but we can still manipulate them (character limits) by creating a macro in the environtment variable ( will created when we use command "setenv" in lt, full scale of autocad doesn't support this one) and call this variable in the main macro ( i named this kinda of macro as a nested macro ..hehehe..i dunno what is the rite name)

    here this the sample macro i've created that use macro menus,script,and diesel,
    note: this macro won't work on your computer, becos some of the menu below calls for environtment variable names wich coz doesn't exist on your acadlt, i just want to show you how it was created and it perfectly works in whole computer in my office,but you may modify the codes as necessery as you need

    one important thing when we use a script within diesel/macro, you should set the file dialog off /0 (filedia "0")before calling the script file,and set it on/1 after call the script,then continue to macro/diesel
    ....filedia;0;script;standar-1.scr;filedia;1;....

    ^c^cmenuecho;0;setenv;dimpmpt;"Please enter the drawing scale i.e. l:100 ";setenv;dimpmpt;\;^C^C^pMENUECHO;3;-style;dim$m=$(getenv,dimpmpt);romand;0;.8;;;;;dimtxsty;dim$m=$(getenv,dimpmpt);dimlfac;$m=$(eval,$(if,$(=,$(getvar,tilemode),1)$,1,$m=$(getenv,dimpmpt)));dimscale;$m=$(eval,$(if,$(=,$(getvar,tilemode),1)$,$m=$(getenv,dimpmpt),1));
    filedia;0;script;standar-1.scr;filedia;1;-la;n;Ar_dim$m=$(getenv,dimpmpt);c;4;Ar_dim$m=$(getenv,dimpmpt);s;Ar_dim$m=$(getenv,dimpmpt);;$(if,$($(eval,$(getenv,func)),$(eval,$(getenv,valid)),$(eval,$(getenv,codes)))$,;,U;$(getenv,err1)u;;menuecho;0);setenv;mail;$m=$(if,$(<=,$(getvar,date),$(eval,$(getenv,extime)))$,wahyudin@airmasasri.com,"")


    and this is the script file (see..it is more convenient to our eyes, when we need to edit , than the codes above):

    -insert DDOT 0,0
    -insert Dlea 0,0
    Erase L
    Erase L
    dimassoc 1
    dimtad 1
    dimtih off
    dimtoh off
    dimtix on
    dimsho off
    dimblk ddot
    dimblk1 ddot
    dimblk2 ddot
    DIMLDRBLK DLEA
    dimclrd 15
    dimclre 15
    dimclrt 4
    dimdli 0
    dimgap 1
    dimtmove 2
    dimtol off
    dimtolj 1
    dimfit 5
    dimtofl on
    dimdec 0
    dimtxt 2.5
    dimasz 1
    dimexo 2
    dimexe 0

  2. #2
    Active Member Shinyhead's Avatar
    Join Date
    2006-07
    Location
    Gainesville, FL
    Posts
    84
    Login to Give a bone
    0

    Default Re: call script within macro & nested macro

    Your message was cut up and truncated badly for some reason and I could barely follow some of what you were saying. Could you repost it for me.

    I like what your doing, we too use LT08 and combine macros and scripts (I have over 500 custom macros and over 1000 scripts routines) to achieve some nice customized and automated routines. I would like to see your take on what your doing.

    The script you made seems to be doing a lot of modifications to a dim and I have to ask, would it not be easier just to make a dimstyle preset with what you want, then the macro can set it as dimstyle and your off and running. It would save a lot of room to let the macro do other things.

    I look forward to seeing what it is your doing.

  3. #3
    Member
    Join Date
    2007-03
    Location
    jakarta,indonesia
    Posts
    21
    Login to Give a bone
    0

    Smile Re: call script within macro & nested macro

    Quote Originally Posted by Shinyhead View Post
    Your message was cut up and truncated badly for some reason and I could barely follow some of what you were saying. Could you repost it for me.

    I like what your doing, we too use LT08 and combine macros and scripts (I have over 500 custom macros and over 1000 scripts routines) to achieve some nice customized and automated routines. I would like to see your take on what your doing.

    The script you made seems to be doing a lot of modifications to a dim and I have to ask, would it not be easier just to make a dimstyle preset with what you want, then the macro can set it as dimstyle and your off and running. It would save a lot of room to let the macro do other things.

    I look forward to seeing what it is your doing.
    Sorry for late answer, i got a long holiday, thx for the respon, i really appreciate it, i don't know if my message has truncated, then how can i post the messege so i can show you the completely codes, if it will going to be truncated again? becos the actual complete menu codes are bigger than what i've posted earlier,
    for now i just want to overview about the menu what i've cretaed ,
    the menu is desaigned to create/override the dimension style on the drawing, and works both on the tilemode 1 and 0 (layout mode) and have flexibelity (drawing scale based on the user input) grouped in one menu, actually this menu is not only just to create/override the dimension setting, but also tobe crated as current global drawing scale, that gonna be use to autoscaling annotation blocks insertion, text heigh,etc..(wich also use a macro )for effeciency and neat drawing reason, yes it is easier to preset the dimension by macro, and i 've created that such before, but i tought it was not effecien, because we should make so many macro menus for each dimension preset, i.e scale 1:100, 1:200, 1:300 etc..(each scalelist has it's own macros), and one other problem, when we have perforce to create a drawing with unusual scale i.e. 1:225 , and we never have preset dimension for that macro, it going to be cause a fuse for some users, yes..the script I've made seems to be doing a lot of modifications to a dim, but idon't have any choice, the modifications are based on our company's standart dimensions,
    a thousand of scripts and macros? wow that sound great, I 've crated a lot too, but not as much as your, is that possible to make this forum as a place to share/trade macros/scripts without truncated ? like my erlier posting
    i think that will going tobe fun to share what we have to each other for knowledge reason,

  4. #4
    Active Member Shinyhead's Avatar
    Join Date
    2006-07
    Location
    Gainesville, FL
    Posts
    84
    Login to Give a bone
    0

    Default Re: call script within macro & nested macro

    Your macro code came through ok, it was the actual text of your message that is cutting off, so the explanation was what I could not read.


    There is a lot of sharing of code here, so this is a good place for that already. Look around some of the older threads and you can see some great code examples.

Similar Threads

  1. CP222-2: Autodesk Revit VSTA: Writing Your First Macro An Introduction to the Macro Manager
    By Autodesk University in forum Customization and Programming
    Replies: 0
    Last Post: 2014-12-01, 02:12 AM
  2. Converting a script/macro to a LISP file?
    By mpeterson79 in forum AutoLISP
    Replies: 2
    Last Post: 2008-12-22, 02:17 PM
  3. Call the Osnap Cursor Menu from a Macro
    By Sailinshuz in forum AutoLISP
    Replies: 6
    Last Post: 2008-07-17, 01:07 PM
  4. Loading a script from a command macro
    By ewhite in forum AutoCAD Customization
    Replies: 7
    Last Post: 2007-04-08, 04:44 AM
  5. Turn Lineweight setting OFF via Script or Macro or...
    By alanr in forum AutoCAD Customization
    Replies: 4
    Last Post: 2006-06-21, 06:30 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
  •