; 3DFA2SOL.LSP
; Theo L.A. Groenenberg
; Leusden NL
; acadvice@worldonline.nl
; http://www.dra.nl/~acadvice
;
; Converts 3Dfaces to solids.
;
; I'm an architect in Long Island, New York.
; I'm looking for a routine that automatically
; fills an area with a solid, similar to the bhatch command.
; There are commercial applications that do this such as m-color
; but I do not want to spend $300 dollars.
; I you know of any such routines that are more reasonable priced,
; please let me know. Thank you.
;
; George Pardo
;
; Hi George, here's something you can work with.
; Create REGIONs of all your areas using the BPOLY or
; REGION commands.
; Edit them if neccesary with UNION, SUBTRACT, etc.
; Use the 3DSOUT command and select your REGIONs.
; Erase the previous REGIONs.
; Use the 3DSIN command and select add, meshes.
; EXPLODE the MESHes. Now you are left with 3DFACEs.
; Now use this routine.
;
; Sounds complicated, but saves you $300.
;
; Good luck & regards Theo.
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun 3dfa2sol (/ aantal n naam face hoogte solist)
(command "_undo" "_m")
(prompt (strcat "\n" (itoa (sslength faceset)) " 3DFACEs found.\n"))
(setq aantal (sslength faceset)
n 0
)
(prompt "\nConverting 3DFACEs to SOLIDs.....")
(repeat aantal
(setq naam (ssname faceset n)
n (+ n 1)
face (entget naam)
hoogte (/ (+ (caddr (cdr (assoc 10 face)))
(caddr (cdr (assoc 11 face)))
(caddr (cdr (assoc 12 face)))
(caddr (cdr (assoc 13 face)))
) 4
)
)
(entdel naam)
(setq solist (list (cons 0 "SOLID")
(assoc 8 face)
(cons 10 (list (car (cdr (assoc 10 face)))
(cadr (cdr (assoc 10 face)))
hoogte
)
)
(cons 11 (list (car (cdr (assoc 11 face)))
(cadr (cdr (assoc 11 face)))
hoogte
)
)
(cons 12 (list (car (cdr (assoc 13 face)))
(cadr (cdr (assoc 13 face)))
hoogte
)
)
(cons 13 (list (car (cdr (assoc 12 face)))
(cadr (cdr (assoc 12 face)))
hoogte
)
)
(cons 39 (* -1 hoogte))
)
)
(entmake solist)
)
(redraw)
(prompt "The command UNDO with the option BACK\n\nwill undo everything to the start of 3DFA2SOL.")
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:3dfa2sol (/ faceset)
(setvar "cmdecho" 0)
(setvar "splframe" 1)
(prompt "\nSelect 3DFACEs.")
(setq faceset (ssget '((0 . "3DFACE"))))
(if faceset
(3dfa2sol)
(alert "No 3DFACEs found.")
)
(prompt "\nRegards Igal.")
(princ)
)
(c:3dfa2sol)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Advertisements