Dimension extension lines

Discussion in 'AutoCAD' started by ~Jeff~, Sep 30, 2004.

  1. ~Jeff~

    ~Jeff~ Guest

    Does anyone have a lisp routine that will turn off the extension lines when
    the dimension is selected. Better yet, a lisp that turns off the selected
    dimension extension line (leaving the other extension line unless that is
    selected too).
     
    ~Jeff~, Sep 30, 2004
    #1
  2. ~Jeff~

    Tom Smith Guest

    NOX = no extension. Turns off the selected extension line. A crude hack
    which works, maybe there's a fancy vlisp way of doing the same.

    (defun c:nox(/ stillon tryext oce es en pt ed)
    (defun stillon (edata pnt / ssp)
    (if (setq ssp (ssget pnt))
    (equal
    (cdr (assoc -1 edata))
    (ssname ssp 0))))
    ;Return T if extension goes away, nil otherwise
    (defun tryext (extnum edata pnt)
    (command "dim" "override" (strcat "dimse" (itoa extnum)) "on" "" en "")
    (cond
    ((stillon edata pt)
    (command "undo" "exit")
    nil)
    (t
    (command "exit")
    'T)))
    ;Main:
    (setq oce (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (command "undo" "g")
    (if (setq es (entsel "\nPick extension line to suppress: "))
    (progn
    (setq
    en (car es)
    pt (cadr es)
    ed (entget en))
    (cond
    ((notdim ed)
    (princ "\nNot a dimension."))
    ((tryext 1 ed pt))
    ((tryext 2 ed pt))
    ((princ "\nNot an extension line.")))))
    (command "undo" "e")
    (setvar "cmdecho" oce)
    (princ))
     
    Tom Smith, Sep 30, 2004
    #2
  3. ~Jeff~

    ~Jeff~ Guest

    It worked for you?

    I tried this and recieved:

    Command: nox

    Pick extension line to suppress: ; error: An error has occurred inside the
    *error* functiontoo many arguments
     
    ~Jeff~, Sep 30, 2004
    #3
  4. ~Jeff~

    Tom Smith Guest

    Here's my "crude hack.":)

    Hi, Herman! Yours may be more ambitious than mine, and it can't be any
    cruder, I'll have to analyze it.

    Mine requires you to pick the extension line itself. Since I had no way of
    knowing which dim extension is which, I simply turn off dimse1, then use an
    ssget on the picked point to see if the same dimension entity is still
    there -- if so, turn dimse1 back on and turn off dimse2. Trial and error!

    I'm not exactly proud of this as elegant programming, but hey it works! If
    you can't figure out how to solve a problem by pure logic, sometimes an
    empirical approach can work just as well.
     
    Tom Smith, Sep 30, 2004
    #4
  5. There's one I use called XL-TOGL, that incorporates both XLON and XLOFF to
    do just what you ask, but both on and off. It works quite well. You don't
    select on the extension line itself (because that wouldn't be possible to
    turn it on), but on the dimension line, and it turns on or off the nearer
    extension line.

    I'm pretty sure I got it from Cadalyst Magazine's "Hot Tip Harry" column,
    but I don't remember exactly when -- several years ago now. Maybe you can
    find it on www.cadalyst.com.

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Sep 30, 2004
    #5
  6. ~Jeff~

    Walt Engle Guest

    This is great. Thanks. I have wanted something like this for a long time and am tired of using
    Modify>Properties and changing extension lines to Off.
     
    Walt Engle, Sep 30, 2004
    #6
  7. ~Jeff~

    Doug Broad Guest

    Jeff,
    You've gotten a lot of great help. Don't forget you can always
    double click on the dimension(s) and click "Lines and Arrows"
    and choose "Ext line 1" or "Ext line 2" On/Off
     
    Doug Broad, Oct 1, 2004
    #7
  8. ~Jeff~

    Doug Broad Guest

    Herman,
    The ommission of the most important aspects of a dimension from the
    ActiveX object model is one the most surprising shortcomings. Autodesk
    should receive a "D-" grade on their ActiveX dimension implementation.

    I always use DXF data to get that information. Haven't needed to
    change that kind of stuff using ObjectDBX yet.

    Thanks for informing us that it is available in ARX. It makes me think
    that Autodesk has deliberately hobbled the LISP/VBA environment
    to limit any serious addon competition to those using ARX/C++...

    Regards,
    Doug
     
    Doug Broad, Oct 1, 2004
    #8
  9. ~Jeff~

    Doug Broad Guest

    I prefer to believe this is an oversight.

    I have no evidence to the contrary. ;-)

    Plain LISP still works fine (as you say). It would seem to affect
    those using VBA more although I don't use VBA enough to know.
    It would be a pleasant surprise to see the ActiveX gaps filled in
    but it would also be unexpected.

    Nice to talk to you. Take care. Got to go. Need to go buy
    a copy of "Catcher In The Rye." ;-)

    Regards,
    Doug


    <clipped above>
     
    Doug Broad, Oct 1, 2004
    #9
  10. Now that you jog my memory, I do recall the original hot tip had a quirk
    where it "found" the wrong extension line if there was a large difference in
    the length of the extension lines (e.g., greater than the dimension length,
    give or take). I didn't write the routine, but I did send in a fix to
    overcome that problem -- I had forgotten about that. (But there was no
    check involved --- or is that something else I'm forgetting?)

    Kent Cooper, AIA


     
    Kent Cooper, AIA, Oct 1, 2004
    #10
  11. ...
    Of course, if you want to use the XLON part to un-suppress an extension line
    that's suppressed, you can't pick an extension line, anyway, because it
    doesn't appear. Picking on the dimension line (and I think it works on the
    dimension text or arrow, too) allows the same approach to be used for both
    XLON and XLOFF.

    Kent Cooper, AIA
     
    Kent Cooper, AIA, Oct 1, 2004
    #11
  12. ~Jeff~

    Doug Broad Guest

    Just joshing. Hoping you would pick up the reference
    to the movie "Conspiracy Theory".

    Have a nice weekend.
     
    Doug Broad, Oct 1, 2004
    #12
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.