Drawing origin

Discussion in 'AutoCAD' started by dveusa, Apr 28, 2008.

  1. dveusa

    dveusa Guest

    We need to change about 2000 drawings from a company we just
    acquired.
    In orde to be able to do that automaticaly with a batch processor we
    need to move the origin (0,0) to the left bottom of each drawing (or
    the other way around).
    I have been trying all kind of things but I can't get it done without
    manual intervention for each drawing.
    Is there a way to do this automatically with a lisp routine or
    otherwise?
    Thanks for any help.
    Daniel
     
    dveusa, Apr 28, 2008
    #1
  2. dveusa

    strawberry Guest

    You must mean the other way round. You can't move the universe - but
    you can move everything else relative to it!
    What defines the 'bottom left of each drawing'?
     
    strawberry, Apr 28, 2008
    #2
  3. dveusa

    Guest Guest

    extmin and extmax.

    Bob
     
    Guest, Apr 28, 2008
    #3
  4. dveusa

    dveusa Guest

    Each drawing consists of a drawing with a title block . Bottom left is
    the bottom left corner of the title block. At the moment the bottom
    left corner is each time at a different location and we want to bring
    this corner back to 0,0,0.
     
    dveusa, Apr 30, 2008
    #4
  5. dveusa

    strawberry Guest

    And just to clarify... these titleblocks are in modelspace, right?
     
    strawberry, Apr 30, 2008
    #5
  6. dveusa

    dveusa Guest

    Yes they are in modelspace.
     
    dveusa, Apr 30, 2008
    #6
  7. dveusa

    strawberry Guest

    Assuming that castlebravo's right, and the bottom left hand corner of
    the titleblock really is the minimum extent of the drawing then a
    script like this should work:

    (command ".-layer" "t" "*" "U" "*" "ON" "*" "")
    (command ".move" "all" "" (getvar "extmin") "0,0,0")
    (command "layerp")
    (command "qsave")

    You can use scriptpro (free from autodesk) to batch execute this
    script on several files. ScriptPro is very old fashioned and the
    interface is poisonously frustrating, but it will do the job. I
    strongly suggest you make copies of the files before executing the
    script - just in case I've done something wrong - and, at least to
    begin with, only execute the script on a few files at a time.

    Good luck, and let us know how you get on.
     
    strawberry, May 3, 2008
    #7
  8. dveusa

    dveusa Guest

    Dear Strawberry,

    The keyline is: move" "all" "" (getvar "extmin") "0,0,0"
    I am using "Batch Script Processor v3.0.11" as a batch processor and I
    had to adapt the script as follows:

    -layer
    t
    *
    U
    *
    ON
    *

    move
    all

    (getvar "extmin")
    0,0,0
    layerp
    zoom
    e
    qsave

    Now it works perfectly.
    Thanks for your help

    dveusa
     
    dveusa, May 5, 2008
    #8
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.