PDA

View Full Version : Convert 3D Faces to Solids


Captain35
2006-11-22, 03:09 PM
Can somebody alter this lisp routine so that the 3d faces retain there z values. The lisp routine works great otherwise but it extrudes the 3d faces down to a Z value of (0). It looks like It has to do with the (caddr x) of a point. I see car [x value] and cadr [y value], but the caddr [z value] does not show up in the code.

help

Kirk

CAB2k
2006-11-22, 05:54 PM
I'm no 3D guy but this may do it.
(defun 3dfa2sol2 (/ 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)))
(caddr (cdr (assoc 10 face)))
)
)
(cons 11 (list (car (cdr (assoc 11 face)))
(cadr (cdr (assoc 11 face)))
(caddr (cdr (assoc 11 face)))
)
)
(cons 12 (list (car (cdr (assoc 13 face)))
(cadr (cdr (assoc 13 face)))
(caddr (cdr (assoc 13 face)))
)
)
(cons 13 (list (car (cdr (assoc 12 face)))
(cadr (cdr (assoc 12 face)))
(caddr (cdr (assoc 12 face)))
)
)
(cons 39 0 ); (* -1 hoogte))
)
)
(entmake solist)
)
(redraw)
(alert "The command UNDO with the option BACK\n\nwill undo everything to the start of 3DFA2SOL.")
)

Captain35
2006-11-22, 06:55 PM
Converting 3DFACEs to SOLIDs.....error: bad argument type: numberp: nil

didn't work:

CAB2k,

Can I send you a 5mb .dwg that will show you what I am trying to do?

CAB2k
2006-11-22, 07:15 PM
Try again, I changed the code.
Although not sure what dxf 39 should be?

Captain35
2006-11-22, 08:49 PM
the lisp is still not working:

Here is a portion of the objects that I am trying to change the 3d faces to solids.

Thanks for your help,

Kirk

CAB2k
2006-11-22, 11:30 PM
OK, looking at your drawing, you are trying to convert the faces of the duct work into solids.
Problem as I see it is there are inner faces & outer faces. Aside from that the DXF code 39 is the
thickness of the solid & will work for the bottom at 0.5 and -0.5 for the top. This is ignoring the
faces on the inside of the duct work. For the side faces you will need to rearrange the coordinates,
I think. Else you will have to create a solid with a OCS other than 0 0 1.
This is not my area so someone else will have to help you with this one.

David.Hoole
2006-11-24, 04:15 PM
Kirk

Here's a link to a programme which allows you to specify an overall depth/thickness for the resulting solid:

http://discussion.autodesk.com/thread.jspa?threadID=500988

Captain35
2006-11-27, 02:24 PM
David,

Thanks for the link I will check this out after I get back from AU....

Kirk

Captain35
2006-12-07, 08:04 PM
I am back after AU and the lisp routines are not working, here is an example. Maybe I am doing something wrong with the user input.

Thanks

Kirk