LISP Swaping per Border?

Discussion in 'AutoCAD' started by MiD-AwE, Mar 18, 2005.

  1. MiD-AwE

    MiD-AwE Guest

    Hi all,

    I have three different size borders that I use. They print on three different paper sizes they are 11x17, 24x36, & 34x44.
    I have specific command setup for zoom to special locations on the modelspace and these locations are different for each border. 80% of our drawings are done as 11x17 so the commands really only work for that size drawing and are eternally broken for the others.

    My question is this: is it possible to have a simple addition to my simple lisp command that will check for <border size> and direct the following commands based on that. Or, do I have to rewrite the commands and manually load them each time I use the two offending border sizes? Thanks.
     
    MiD-AwE, Mar 18, 2005
    #1
  2. are the borders xrefs?
    do you have only one border xreffed at a time? (cant imagine you have three sheets side by side in MS...)

    If yes to both questions, make a list of the xrefs and use the naming of your borders to switch what gets set up.
    Or you could manually set a flag in the drawing dictionary
    or maybe use a user variable (junky method).

    Tell us more specifics of your drawings and we can tell you how to make code that makes decisions based on it.


    MiD-AwE <>
    |>Hi all,
    |>
    |>I have three different size borders that I use. They print on three different paper sizes they are 11x17, 24x36, & 34x44.
    |>I have specific command setup for zoom to special locations on the modelspace and these locations are different for each border. 80% of our drawings are done as 11x17 so the commands really only work for that size drawing and are eternally broken for the others.
    |>
    |>My question is this: is it possible to have a simple addition to my simple lisp command that will check for <border size> and direct the following commands based on that. Or, do I have to rewrite the commands and manually load them each time I use the two offending border sizes? Thanks.

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Mar 18, 2005
    #2
  3. MiD-AwE

    ECCAD Guest

    Assuming you are using Xref's, try:

    (setq data (tblsearch "block" "border1")); if nil, No Xrefed 'border1' blocks
    (if data
    (progn
    ;; do operations for border1 here
    ); progn
    ); if
    (setq data (tblsearch "block" "border2")); if nil, No Xrefed 'border2' blocks
    (if data
    (progn
    ;; do operations for border2 here
    ); progn
    ); if
    (setq data (tblsearch "block" "border3")); if nil, No Xrefed 'border3' blocks
    (if data
    (progn
    ;; do operations for border3 here
    ); progn
    ); if
     
    ECCAD, Mar 20, 2005
    #3
  4. MiD-AwE

    MiD-AwE Guest

    I'm using the method that was established before I started here. Each border is saved as individual DWG files. We open the appropriate DWG to draw directly in the border.

    I force the drafter to save the drawing under the job name so that the borders are not damaged by the drafter's accidental saves as the border name. I also set each of the borders as "read only".

    If this is a stupid way of doing things then I can work on XREF-ing our borders but if I do I'll need to recognize the border size used and set up layers with viewports specific to that border. (Could be more unified but not as simple a question.) Interesting prospect for the ability to change border sizes without having to select all, copy from base point then paste in new drawing.

    For now I'll be satisfied with BLOCK-ing the border and leaving it in the individual DWGs named for the sizes. The <Drawingname> wont help since the drawings are renamed to the job each time a new drawing is started. So if I just made blocks of the borders inside of the dwg files I could search the table for that block name and adjust specific code for the name found. This helps also that the DWG wont need to be purged, since it wont be possible to insert the incorrect XREF. I'm not sure if that would present any new issues.

    I have little experience working with XREFs but I am curious as to how we can benefit from them. We have been using WBLOCKs here due to our blocks are mostly for details that are customized for nearly every drawing though we have many blocks that change only every couple of years.

    If you need any more information let me know. Thanks.
     
    MiD-AwE, Mar 21, 2005
    #4
  5. MiD-AwE

    MiD-AwE Guest

    I think that I can see what you are doing here and may be able to modify it for my needs. Thanks.
     
    MiD-AwE, Mar 21, 2005
    #5
  6. I am not following you, I like this topic though.
    Can you answer these items one at a time:
    1) do you ever get more than one border size in a drawing at one time?
    2) is there anything unique about each border besides the coordinates and lengths of linework?

    Using blocks is not a bad idea, but check for actual inserts, not just block definitions. I would use blocks if you do
    not want xrefs...

    Xrefs are useful for repeated info. They are bad for unpredictable situations where you need things to stay "as they
    were" at all times.

    thx



    MiD-AwE <>
    |>I'm using the method that was established before I started here. Each border is saved as individual DWG files. We open the appropriate DWG to draw directly in the border.
    |>
    |>I force the drafter to save the drawing under the job name so that the borders are not damaged by the drafter's accidental saves as the border name. I also set each of the borders as "read only".
    |>
    |>If this is a stupid way of doing things then I can work on XREF-ing our borders but if I do I'll need to recognize the border size used and set up layers with viewports specific to that border. (Could be more unified but not as simple a question.) Interesting prospect for the ability to change border sizes without having to select all, copy from base point then paste in new drawing.
    |>
    |>For now I'll be satisfied with BLOCK-ing the border and leaving it in the individual DWGs named for the sizes. The <Drawingname> wont help since the drawings are renamed to the job each time a new drawing is started. So if I just made blocks of the borders inside of the dwg files I could search the table for that block name and adjust specific code for the name found. This helps also that the DWG wont need to be purged, since it wont be possible to insert the incorrect XREF. I'm not sure if that would present any new issues.
    |>
    |>I have little experience working with XREFs but I am curious as to how we can benefit from them. We have been using WBLOCKs here due to our blocks are mostly for details that are customized for nearly every drawing though we have many blocks that change only every couple of years.
    |>
    |>If you need any more information let me know. Thanks.

    James Maeding
    jmaeding at hunsaker dot com
    Civil Engineer/Programmer
     
    James Maeding, Mar 22, 2005
    #6
  7. MiD-AwE

    MiD-AwE Guest

    OK,

    1) do you ever get more than one border size in a drawing at one time?

    No, all our borders are drawn for the size paper they will be printed. Such as 11X17, 24X36, etc..

    2) is there anything unique about each border besides the coordinates and lengths of linework?

    Since, this discussion I have made blocks of the border frames named for there sizes. Such as 11X17, 24X36, etc..
    So, now I simply search for the blocks by name and then adjust my LISP command. This way I unify commands across all borders. (we use viewports but not quite the same way as everyone else. We use them in layouts to display only certain layers at any time so that we draw one plan yet we extract three useful drawings from that all quickly referenced by layout tabs.) We have drawings that date back to R10 so we need to be able to see exactly how something was built for warranty issues that may arise.
     
    MiD-AwE, Mar 22, 2005
    #7
  8. MiD-AwE

    MiD-AwE Guest

    How can I alert the user of what they need to do if none of the borders are found? Thank you.
     
    MiD-AwE, Mar 22, 2005
    #8
  9. MiD-AwE

    ECCAD Guest

    (setq Flag 0)
    (setq data (tblsearch "block" "border1")); if nil, No Xrefed 'border1' blocks
    (if data
    (progn
    (setq Flag 1)
    ;; do operations for border1 here
    ); progn
    ); if
    (setq data (tblsearch "block" "border2")); if nil, No Xrefed 'border2' blocks
    (if data
    (progn
    (setq Flag 1)
    ;; do operations for border2 here
    ); progn
    ); if
    (setq data (tblsearch "block" "border3")); if nil, No Xrefed 'border3' blocks
    (if data
    (progn
    (setq Flag 1)
    ;; do operations for border3 here
    ); progn
    ); if

    ;; check Flag
    (if (= Flag 0)
    (alert "No Border Blocks Found..do something about it")
    ); if
     
    ECCAD, Mar 22, 2005
    #9
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.