Draw outline of blocks

Discussion in 'AutoCAD' started by jclaidler, Sep 30, 2004.

  1. jclaidler

    jclaidler Guest

    Does anyone have a lisp routine that will draw an outline of a block, or all blocks, contained within a drawing??

    Thanks.
     
    jclaidler, Sep 30, 2004
    #1
  2. jclaidler

    jclaidler Guest

    No one can supply an example on how to accomplish this ??
     
    jclaidler, Oct 1, 2004
    #2
  3. jclaidler

    BillZ Guest

    Well now that you're asking for no one.

    ;;9/29/04 Bill Zondlo
    ;
    ;
    ;
    (defun c:BBox_Pts (/ AcadObj p1 p2 p3 p4)
    (setq AcadObj (vlax-ename->vla-object (car (entsel)))
    )

    (vla-GetBoundingBox AcadObj 'MinPnt 'MaxPnt)
    (setq p1 (vlax-safearray->list MinPnt)
    p2 (vlax-safearray->list MaxPnt)
    p3 (list (car p1)(cadr p2))
    p4 (list (car p2)(cadr p1))
    )

    (grvecs (list -4 p1 p3 p3 p2 p2 p4 p4 p1))

    (list p1 p2)
    )

    hth

    Bill
     
    BillZ, Oct 1, 2004
    #3
  4. jclaidler

    jclaidler Guest

    thanks for your help....

    With this though, a box is drawn around the block.
    I need a actual outline of the block drawn.
     
    jclaidler, Oct 1, 2004
    #4
  5. jclaidler

    BillZ Guest

    Sorry,
    I mis-read your post.

    Bill
     
    BillZ, Oct 1, 2004
    #5
  6. jclaidler

    BillZ Guest

    Just a thought,

    If these are simple 2d blocks, you could use nentsel to get the outside entity(s) and recreate that entity from the eintity information.

    Bill
     
    BillZ, Oct 1, 2004
    #6
  7. jclaidler

    T.Willey Guest

    Here is a way to do it. It is only a start, and idea, but it can lead you where you want to go.

    (setq tbl1 (tblobjname "block" "temp"))
    (while (setq tbl1 (entnext tbl1))
    (setq tm1 (cons (entget tbl1) tm1))
    )
    (mapcar 'entmake tm1)

    It worked on my little 4 item test block.
    Tim
     
    T.Willey, Oct 1, 2004
    #7
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.