+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Junior Member mrgrotey's Avatar
    Using
    AutoCAD LT 2010
    Join Date
    Jul 2006
    Location
    London, England
    Posts
    19

    Default Trouble with custom button, error if trying to select all when nothing in scene

    Registered forum members do not see this ad.

    Hi all,

    I'm trying to set up a button in my ribbon for a simple process I very regularly perform in AutoCAD 2010 LT.

    basically I want to:

    1. Select everything in the model view (through an already active viewport)
    2. Erase it all
    3. Purge everything
    4. Paste in whatever is in the clipboard memory (previously copied from a different drawing) and locate it at 0,0 coords.
    5. Zoom Extents
    6. Zoom out to 97%

    The macro below works perfectly fine as long as there were originally objects in model space to start with, but if I try this with a new file that has no model space objects (I only want one button) it stops at the 'select all' stage and refuses to continue. The error is the standard "Selecting objects...*error*" code and stops there.

    Code:
    ^C^C_ai_selall;erase;all;^C^C_purge;a;*;n;^C^C_pasteclip;0.0;^C^C_z;e;^C^C_z;s;0.97x;

    Is there a way I can get this to work for both intances, when there are objects in model space AND when there are not?

    Michael
    Last edited by SLW210; 5th Sep 2012 at 05:20 pm.

    Click Here

    to see my AutoCAD and 3DS Max Portfolio Website

    * * * * * * * * *
    "People said I was dumb.... but I proved them!"

    Phillip. J. Fry

  2. #2
    Junior Member mrgrotey's Avatar
    Using
    AutoCAD LT 2010
    Join Date
    Jul 2006
    Location
    London, England
    Posts
    19

    Smile Sorted

    Just figured it out. I just got it to add a point object into the scene first then it always had something to erase.

    Thanks for looking though!

    Click Here

    to see my AutoCAD and 3DS Max Portfolio Website

    * * * * * * * * *
    "People said I was dumb.... but I proved them!"

    Phillip. J. Fry

  3. #3
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x86
    CPU:
    Pentium(R) Dual-Core CPU E5500 @ 2.80GHz
    RAM:
    4 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    ThinkVision 22"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    9,128

    Default

    Glad you got it sorted. I have moved this thread to The CUI, Hatches, Linetypes, Scripts & Macros forum.

    Please read the CODE POSTING GUIDELINES and edit your post to include CODE tags for your MACRO.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  4. #4
    Junior Member mrgrotey's Avatar
    Using
    AutoCAD LT 2010
    Join Date
    Jul 2006
    Location
    London, England
    Posts
    19

    Default

    Hi there sorry for the errors, I would edit my post but I dont get any of those formatting buttons to choose from when I go to edit it, even if I choose 'go advanced' so cant really do much. Can you do it? maybe its because my work PC uses IE8? I can see them in the quick reply box at the bottom but not when I go to edit an existing post.

    Click Here

    to see my AutoCAD and 3DS Max Portfolio Website

    * * * * * * * * *
    "People said I was dumb.... but I proved them!"

    Phillip. J. Fry

  5. #5
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x86
    CPU:
    Pentium(R) Dual-Core CPU E5500 @ 2.80GHz
    RAM:
    4 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    ThinkVision 22"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    9,128

    Default

    Registered forum members do not see this ad.

    They should be there in "advanced" even on IE8, but I will get it for you.
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



Similar Threads

  1. Mouse Button Trouble
    By Hardney in forum AutoCAD Drawing Management & Output
    Replies: 2
    Last Post: 11th Jan 2007, 12:10 pm
  2. Dimensions + Middle Button Pan + Locked Viewport = Trouble
    By David_S in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 12th Apr 2006, 10:13 pm
  3. Custom Button
    By jcramos in forum AutoCAD General
    Replies: 3
    Last Post: 17th Dec 2005, 11:50 pm
  4. WBlock/Custom Button Association
    By O-D-C in forum AutoCAD General
    Replies: 3
    Last Post: 8th Nov 2005, 01:18 am
  5. How to make this custom toolbar button?
    By Cadastrophic in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 30th Oct 2004, 01:23 am

Tags for this Thread

Bookmarks

Posting Permissions

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