Results 1 to 6 of 6

Thread: Adding scripts to toolbar / palette

  1. #1
    AUGI Addict .chad's Avatar
    Join Date
    2006-04
    Location
    is it lunch time yet?
    Posts
    1,129
    Login to Give a bone
    0

    Default Adding scripts to toolbar / palette

    I'm apparently a decade behind and just discovered scripting for CAD. I have a couple basic scripts that I'd like to add to a toolbar / palette / ribbon button but can't figure out how to make it call the script. I've looked through google and most of what I can find is a bit outdated

    If there are more elegant solutions than script's I'm open to that too. Most of what I have are basic things like turning layers in X-Ref's off.

    I'm using ACA 2011.

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Adding scripts to toolbar / palette

    Do you want to call (open and execute) a script [.SCR] file or just include the script in the command itself?

    For the latter, you can open the CUI and create a new command and then in the macro field, enter your script commands. Otherwise, open the CUI and create a new command that calls the ._script command and then the name of your script file.

    Example
    ^c^c._script;c:/cadstuff/myscript.scr;
    Last edited by rkmcswain; 2010-10-06 at 04:01 PM. Reason: add url
    R.K. McSwain | CAD Panacea |

  3. #3
    AUGI Addict .chad's Avatar
    Join Date
    2006-04
    Location
    is it lunch time yet?
    Posts
    1,129
    Login to Give a bone
    0

    Default Re: Adding scripts to toolbar / palette

    Quote Originally Posted by rkmcswain View Post
    Do you want to call (open and execute) a script [.SCR] file or just include the script in the command itself?

    For the latter, you can open the CUI and create a new command and then in the macro field, enter your script commands. Otherwise, open the CUI and create a new command that calls the ._script command and then the name of your script file.

    Example
    ^c^c._script;c:/cadstuff/myscript.scr;
    I'm partial to calling the .scr file. Is there an advantage either way, other than I can drop one on the network and grab it / use it on any workstation?

    If I create a new command do I include the ^c bit or just input what I want? I actually did try doing that but it didn't work out too well.

    Thanks.


  4. #4
    AUGI Addict .chad's Avatar
    Join Date
    2006-04
    Location
    is it lunch time yet?
    Posts
    1,129
    Login to Give a bone
    0

    Default Re: Adding scripts to toolbar / palette

    Have it working other than one small hiccup - how do I reference a folder with spaces in the name? i.e. c:/cad stuff/myscript.scr

  5. #5
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Adding scripts to toolbar / palette

    Quote Originally Posted by .chad View Post
    Have it working other than one small hiccup - how do I reference a folder with spaces in the name? i.e. c:/cad stuff/myscript.scr
    Example

    ^C^C._script;"C:/Temp/cad stuff/My test stript.scr";
    R.K. McSwain | CAD Panacea |

  6. #6
    AUGI Addict .chad's Avatar
    Join Date
    2006-04
    Location
    is it lunch time yet?
    Posts
    1,129
    Login to Give a bone
    0

    Default Re: Adding scripts to toolbar / palette

    I knew that

    Thanks.

Similar Threads

  1. Adding a new tag to tool palette
    By hhuang in forum AMEP General
    Replies: 1
    Last Post: 2008-09-16, 06:32 PM
  2. Partial user profile import - toolbar and tool palette settings
    By .chad in forum AutoCAD Customization
    Replies: 2
    Last Post: 2007-04-06, 03:53 PM
  3. How do you take a button from Toolbar and copy it to a Palette?
    By mjohnson.88569 in forum AutoCAD Customization
    Replies: 4
    Last Post: 2006-05-24, 08:22 PM
  4. Adding LSP routine to Tool Palette
    By sodeepva in forum AutoCAD General
    Replies: 5
    Last Post: 2006-03-31, 11:47 PM
  5. Adding a drop down window to a toolbar
    By dsolak in forum VBA/COM Interop
    Replies: 6
    Last Post: 2006-03-01, 05:02 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
  •