Finding empty areas in drawing

Discussion in 'AutoCAD' started by RaghuMN, May 3, 2004.

  1. RaghuMN

    RaghuMN Guest

    Hi all,

    I have a dense drawing with enormous features.

    I have to place Texts with leader lines to some of these.

    Since the drawing is dense, I cannot place the Text next to the feature. Hence, I have to find empty areas in the drawing that are near to the features.

    Leader line can cross the features.

    Direction is no limit.

    How can I do this?

    Any suggestions please?

    Thanks,
    MNRaghu
     
    RaghuMN, May 3, 2004
    #1
  2. RaghuMN

    Joe Burke Guest

    Maybe the eyeball function? :)

    Joe Burke


    have to find empty areas in the drawing that are near to the features.
     
    Joe Burke, May 3, 2004
    #2
  3. RaghuMN

    bob.at Guest

    try to use the function "qleader" (from Dimension menu)

    bob.at
     
    bob.at, May 3, 2004
    #3
  4. RaghuMN

    RaghuMN Guest

    Thanks Bob, but my requirement was to find the empty areas in the drawing nearby the feature programatically. Qleader cannot do this.

    Any more ideas please.

    Thanks,
    MNRaghu
     
    RaghuMN, May 4, 2004
    #4
  5. RaghuMN

    Juerg Menzi Guest

    Juerg Menzi, May 4, 2004
    #5
  6. RaghuMN

    Larry Travis Guest

    This could be doable with some rather deliberate, although not particularly
    elegent, programming. If you know the area of empty space you require (the
    bounding box of the text or mtext) you can just specify an (ssget "w")
    selection right at the point of your target and within a loop, continue to
    specify selection windows that get progressively further away from your
    target. Once the selection returns an empty set, you have found your
    solution.

    LT



    Hence, I have to find empty areas in the drawing that are near to the
    features.
     
    Larry Travis, May 4, 2004
    #6
  7. RaghuMN

    Larry Travis Guest

    Ok I had to test my theory. Again, it is not elegant, and has no error
    checking, etc., but this little routine has you pick a point and a rectangle
    to define the size of empty space you wish to find. It will then find the
    closest empty area of the dimensions you specified and will draw a rectangle
    in that area. I am sure it needs cleaning up and all but I suppose it could
    provide a framework.

    LT



    (defun c:emptyarea (/ emptyarea ur ll p1 p2 bound_x bound_y counter ang
    ang2)
    (setq tar (getpoint "target: "))
    (setq p1 (getpoint)
    p2 (getcorner p1)
    )
    (setq bound_x (abs (- (car p1) (car p2))))
    (setq bound_y (abs (- (cadr p1) (cadr p2))))
    (setq counter 1)

    (while (and (not emptyarea)
    (< (* counter bound_y) (getvar "viewsize"))
    ) ;and
    (setq ang (angle '(0 0) (list (* 2 counter) 1)))
    ;double counter to have test areas overlap at midpoints
    (setq ang2 ang)
    (while (and (not emptyarea) (< ang2 (* 2 pi)))
    (setq mc (polar tar ang2 (* counter (/ bound_y 2.0))))
    ;divide bound_y to overlap test areas at midpoints
    (setq ll (mapcar '- mc (list (/ bound_x 2) (/ bound_y 2))))
    (setq ur (mapcar '+ ll (list bound_x bound_y)))
    (if (not (ssget "c" ll ur))
    (setq emptyarea (list ll ur))
    ) ;if
    (setq ang2 (+ ang2 ang))
    ) ;while

    (setq counter (1+ counter))
    ) ;while

    (command ".pline"
    ll
    (list (car ll) (cadr ur))
    ur
    (list (car ur) (cadr ll))
    "c"
    ) ;command


    )
     
    Larry Travis, May 4, 2004
    #7
  8. RaghuMN

    RaghuMN Guest

    Thanks Juerg and Larry.

    Both your ideas is a step forward towards my requirement, but stops a little behind.

    There is a command in Arc/INFO application software (an ESRI GIS product) which does the requirement I wish to do for my AutoCAD requirement.

    In a dense Arc/INFO coverage, after generating the labels (annotation) for all the features based on certain attributes, most of them overlap on each other with the default locations. With a command that I refer (from Arc/INFO software), most of their labels get moved(distributed) to the empty areas nearby. This is what the logic that I am trying to get.

    Does my above input give some more clues to move towards my actual requirement?

    Thanks for current answers and advance thanks for continuing support.

    MNRaghu
     
    RaghuMN, May 5, 2004
    #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.