Script will work dependant on Zoomed area

Discussion in 'AutoCAD' started by J. Logan, Aug 13, 2004.

  1. J. Logan

    J. Logan Guest

    I've been writing scripts for 20 years or so. Just recently I've noticed
    some of my newer scripts in 2004 won't work unless a zoom of some sort is
    performed. Or, put another way. A certain x portion of the drawing must be
    visible. Am I going crazy?

    I've created a simple move script that will find a datestamp and move it x
    amount to the right. In the old days they had the datestamp lining up on the
    extreme left side of the page. When the sheets are bound together you can't
    read the info. So recently we've started moving it to the right to avoid
    this issue. I've written a quick little script for my own use that
    accomplishes this. However, when I first wrote the script I noticed that I
    needed to be zoomed in pretty close for the move selection to work. Then
    zoom out x scale factor to get back to where I started.

    Today I just wrote another script to erase some pound signs (#) used to
    designate "Text needed here" and insert a block of the needed text into the
    erased text positions. I'm erasing 4 different pound signs. 2 in the lower
    right hand corner of the drawing and 2 in the upper right hand corner. If I
    just open the drawing and run the script only 1 pound sign gets removed. But
    if I add a Zoom All or Zoom extents to the script it erases all the
    necessary pound signs.

    Why is this?

    J. Logan
     
    J. Logan, Aug 13, 2004
    #1
  2. J. Logan

    J. Logan Guest

    Now for some reason if I remove the first Zoom Window and go with Move and
    then Zoom the object I'm trying to move doesn't get moved.

    ^C^CZOOM W -.5,-.5 5,3 Move .2,.2 .2,.2 1.325,.2 ^C^Czoom all zoom scale
    ..85x

    --------------------- another example -------------------
    This particular one I've gone with just Zooming extents manully before
    Whacking the button to run the script file. If I don't zoom Extents all that
    gets erased is the object at 29.22,.3445.

    ^C^CFILEDIA 0 _SCR "ERASE CHK-APP" FILEDIA 1

    Erase CHK_APP.SCR (below)

    _ERASE
    29.222,.3445
    30.2205,.5623
    31.5,20.7
    31.812,20.4228

    _INSERT
    TRS-DLS-JRL
    31.75,20.25
    1
    1
    0

    J. Logan
     
    J. Logan, Aug 16, 2004
    #2
  3. J. Logan

    J. Logan Guest

    I've already started taking that step. I've written the routine in Lisp and
    have tested just need to get back to it and tweak it when I have a chance.

    Thanks Jon

    J. Logan

    A little LISP might
     
    J. Logan, Aug 17, 2004
    #3
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.