Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Improve on macros

  1. #1
    Member
    Join Date
    2006-07
    Posts
    21
    Login to Give a bone
    0

    Question Improve on macros

    Can anyone improve on this macro? It’s a polyline stretch command and it’s very handy for my sheet metal drawings.

    ^C^C_snap;off;_stretch;Cp


    I also have few macro’s to change my snap settings. Not working to great. When I select line or polyline and then select the snap command it lets go of the prev command. I have to click on snap macro before I select line/polyline i.a. I would like these macro to work the other way around to.

    ^C^Csnap;1;
    ^C^Csnap;5;
    ^C^Csnap;10;

    Ay ideas.
    Thanks

  2. #2
    I could stop if I wanted to
    Join Date
    2001-12
    Location
    Dallas, TX
    Posts
    229
    Login to Give a bone
    0

    Default Re: Improve on macros

    ^C^C is instructing AutoCAD to cancel all running commands: your instructions. Like you tapping ESC button on your keyboard twice.

    I bet that's not what you do when typing for snap settings, is it? Macros are like manually typing commands with your keyboard: I'm going to ask you to find out how to TYPE what you want at the keyboard then write your own macro. Come back if you get stuck after trying (teaching you to fish and all that...).

  3. #3
    Member
    Join Date
    2006-07
    Posts
    21
    Login to Give a bone
    0

    Default Re: Improve on macros

    Thanks for your reply Dean.

    There is no polyline stretch command in the newer versions of AutoCAD. The last time there was is 2004 if I remember correctly. The one I have works very well, I was just wondering if it could be improved. “^C^C_snap;off;_stretch;Cp”
    The snap commands works to. The problem there is, if I select Line – then click on my snap macro I lose the line command. I would like to Click, Draw Line – Click my snap macro – and continue drawing.


    Thanks Donovan

  4. #4
    I could stop if I wanted to
    Join Date
    2001-12
    Location
    Dallas, TX
    Posts
    229
    Login to Give a bone
    0

    Default Re: Improve on macros

    ^C^C code cancels the running command: is that what you want? Your first post complained it's not what you want, yet you repeated it. You keep saying it's not what you want, yet you keep typing it in macros. I'm curious why.

    "_snap;_off"

    But wouldn't just tapping F9 button, or if you must click something, clicking on the Snap button at the bottom of the screen get you what you want without righting more code?

    STRETCH command's CP choice requires multiple picks by you, followed by a manual <enter> on the keyboard before you stretch: you can't just pick the line/pline. Are you aware of this? I suspect you are not testing at the command line by typing these with your fingers to test, you are just blindly copying macros from some source perhaps?

    You can't run STRETCH command while inside LINE or PLINE command: if that is your intent, you are out of luck.

  5. #5
    Member
    Join Date
    2006-07
    Posts
    21
    Login to Give a bone
    0

    Default Re: Improve on macros

    Thanks for your response Dean.

    The polyline Toolbar short cut I created works well. It let me stretch complex drawings without the need to touch the keyboard.
    Select the Icon on my Custom Toolbar – left click to draw a polyline reagent (as many left clicks as I need) when the area have been defined – Right click the mouse – Left click on “Enter” (from the right click menu) – left click Mouse - Left click again to define from were to stretch – I can now enter a distance and/or a angle as needed. If I need to stretch only certain areas of a complex drawing this command work great. I know there is a few left – right click with the mouse involved, hence my question “Can it be improved?”

    The snap custom toolbar short cut’s is the problem. I want to change the snap distance (Custom Toolbar with Snap settings “ 1 – 5 - 10 – 96 …..ea “ ) without touching the keyboard.
    Removing the ^C^C on the macro don’t help.

    For example: I select polyline draw – then select my “5 snap icon” draw a while then change the snap to my “10 snap icon” (without losing the current polyline command I’m in) and keep on drawing, without losing my polyline command. Keep clicking on my custom icons when I need to change the snap distance.
    I do not want to use the keyboard at all. Not even F9.

    Please see my Toolbar Pic.

    Thanks Donovan
    Attached Images Attached Images

  6. #6
    I could stop if I wanted to
    Join Date
    2001-12
    Location
    Dallas, TX
    Posts
    229
    Login to Give a bone
    0

    Default Re: Improve on macros

    To run SNAP while in a command you must add an ' before the name, just like you would to activate ZOOM or PAN or DSETTINGS or GRID and so many others while in a command:

    'snap;off

    This goes back to the testing I keep mentioning you need to do at the command line while using the keyboard to TEST a macro before trying to use it. Ignore this advise and you just keep spinning all day long getting nothing resolved.

    Happy coding.

  7. #7
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Improve on macros

    There is no "polyline stretch" function, there is a "stretch" command that works on polylines and everything else.
    As Dean said, you should test your macros at the command line but, first, you should read the acad user manual and the programmers' guide.

  8. #8
    Member
    Join Date
    2006-07
    Posts
    21
    Login to Give a bone
    0

    Default Re: Improve on macros

    I know there is a stretch command, but the area you select with normal stretch command only let you select a rectangle/ squire area to stretch. My macro let you select any area / shape you want.

  9. #9
    Member
    Join Date
    2006-07
    Posts
    21
    Login to Give a bone
    0

    Default Re: Improve on macros

    Thanks Dean

    My snap macro’s looks like this now:
    'snap;0;
    'snap;1;
    'snap;5;
    'snap;10;
    'snap;96;
    And works the way I want it to work.

    I added a picture of my custom stretch command. I can stretch the selected area up without stretching the dashed "door stiffener" in on command.
    Attached Images Attached Images

  10. #10
    Certified AUGI Addict jaberwok's Avatar
    Join Date
    2000-12
    Location
    0,0,0 The Origin
    Posts
    8,570
    Login to Give a bone
    0

    Default Re: Improve on macros

    Quote Originally Posted by donovans View Post
    I know there is a stretch command, but the area you select with normal stretch command only let you select a rectangle/ squire area to stretch. My macro let you select any area / shape you want.
    Okay, but your terminology is confusing - there has never been a "polyline stretch" command.
    You could more easily and more quickly perform the strech in your illustration by picking 2 points, pressing "R" and clicking the dashed line(s).

Page 1 of 2 12 LastLast

Similar Threads

  1. Macros
    By franchevich in forum AutoCAD General
    Replies: 12
    Last Post: 2010-08-04, 05:18 AM
  2. Macros
    By christopher.r.schroll in forum VBA/COM Interop
    Replies: 2
    Last Post: 2009-02-13, 04:51 PM
  3. Macros...
    By franciscoabaza in forum AutoCAD General
    Replies: 1
    Last Post: 2009-01-06, 10:36 PM
  4. Macros
    By narlee in forum Revit Architecture - Wish List
    Replies: 7
    Last Post: 2005-06-22, 07:17 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
  •