explode 3dface

Discussion in 'AutoCAD' started by Ken, Jun 12, 2004.

  1. Ken

    Ken Guest

    Dear all,

    how to explode 3dface to line entity?

    thx
     
    Ken, Jun 12, 2004
    #1
  2. Ken

    Jason Rhymes Guest

    Convert it to a region using the region command then explode it.
     
    Jason Rhymes, Jun 12, 2004
    #2
  3. Ken

    Juerg Menzi Guest

    Hi Ken

    3DFaces can't explode.
    - Read 'Coordinates' and draw the lines.
    - Don't forget to check for 3 sided 3DFace.
    - If necessary, delete 3DFace.

    Cheers
    Juerg
     
    Juerg Menzi, Jun 12, 2004
    #3
  4. Ken

    Jürg Menzi Guest

    Something like this:

    (defun MeExplode3DFace (Obj / AcaDoc CurSpc PntCnt PntLst TmpObj)
    (setq AcaDoc (vla-get-ActiveDocument (vlax-get-acad-object))
    CurSpc (if (or
    (= (getvar "TILEMODE") 1)
    (> (getvar "CVPORT") 1)
    )
    (vla-get-ModelSpace AcaDoc)
    (vla-get-PaperSpace AcaDoc)
    )
    PntCnt 0
    PntLst (MeTripleUp (vlax-get Obj "Coordinates"))
    PntLst (if (equal (caddr PntLst) (cadddr PntLst) 1E-8) ;3 edges
    (append
    (reverse (cdr (reverse PntLst)))
    (list (car PntLst))
    )
    (append PntLst (list (car PntLst)))
    )
    )
    (repeat (1- (length PntLst))
    (setq TmpObj (vlax-invoke
    CurSpc
    "AddLine"
    (nth PntCnt PntLst)
    (nth (setq PntCnt (1+ PntCnt)) PntLst)
    )
    )
    (vla-put-Color TmpObj (vla-get-Color Obj))
    (vla-put-Layer TmpObj (vla-get-Layer Obj))
    (vla-put-LineType TmpObj (vla-get-LineType Obj))
    (vla-put-LinetypeScale TmpObj (vla-get-LinetypeScale Obj))
    (vla-put-Lineweight TmpObj (vla-get-Lineweight Obj))
    (vla-put-Visible TmpObj (vla-get-Visible Obj))
    )
    (vla-delete Obj)
    (princ)
    )
    ;
    ; -- Function MeTripleUp
    ; Converts a list to a triple point list.
    ; Arguments [Type]:
    ; Lst = List to convert, eg. '(1 2 3 4 5 6)

    • ; Return [Type]:
      ; > Converted list '((1 2 3) (4 5 6))

      • ; Notes:
        ; Credits to Ken Alexander
        ;
        (defun MeTripleUp (Lst / RetLst TmpLst)
        (if (setq TmpLst Lst)
        (while
        (setq RetLst (cons
        (mapcar '(lambda (l) (nth l TmpLst)) '(0 1 2))
        RetLst
        )
        TmpLst (cdddr TmpLst)
        )
        )
        )
        (reverse RetLst)
        )

        Use:
        (vl-load-com)
        (MeExplode3DFace (vlax-ename->vla-object (car (entsel))))

        Cheers
     
    Jürg Menzi, Jun 12, 2004
    #4
  5. Ken

    Ken Guest

    THANKS FOR ALL BEST FRIEND TO HELP!
     
    Ken, Jun 14, 2004
    #5
  6. Ken

    Jürg Menzi Guest

    Hi Ken

    Glad to help you...¦-)

    Cheers
     
    Jürg Menzi, Jun 14, 2004
    #6
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.