CAD Forum - tips, tricks, discussion and utilities for AutoCAD, Inventor, Revit and other Autodesk products [www.cadforum.cz]
Cesky English Deutsch
Login/Register:
 Visitors: 2113 

CAD tip CAD tip # 9063:

Question CAD 
 %  platform  category 
Q - question

Flip 3D faces (front/back) in AutoCAD.

A - answer For simple flipping of faces in AutoCAD (changing back and front sides, with no change in geometry) you can use the free AutoLISP utility CADstudio FlipFace. This LISP application supports both 3-vertex and 4-vertex 3D faces (3DFACE entities).

Download FlipFace from z www.cadstudio.cz/download, load its LSP file with APPLOAD and type the command FLIPFACE. Select the (3DFACE) to flip - their orientation (normals) will change. Face normals - i.e. the direction where the face "faces" - can be checked using the add-on utility Normals (see the tip 8903).

Front faces and unified normals of faces in 3D mesh objects may be important in many scenarios for processing 3D CAD data.

Here is the FlipFace utility as an AutoLISP code:


;FLIPFACE - flip selected 3DFaces (reverse normals) ;(C)2013 - CAD Studio - www.cadstudio.cz - www.cadforum.cz ; (defun C:FlipFace( / ss ssl p1 p2 p3 p4 e edata ndata) (prompt "\nSelect 3DFaces to reverse normals: ") (setq ss (ssget '((0 . "3DFACE")))) (if ss (progn (setq ssl (sslength ss)) (setvar "CMDECHO" 0) (command "_UNDO" "_BE") (while (> ssl 0) (setq edata (entget (setq e (ssname ss (setq ssl (1- ssl)))))) (setq p1 (cdr (assoc 10 edata))) (setq p2 (cdr (assoc 11 edata))) (setq p3 (cdr (assoc 12 edata))) (setq p4 (cdr (assoc 13 edata))) (if (or (equal p1 p4) (equal p3 p4)) ; 3 or 4 point 3DFACE? (setq ndata (subst (cons 10 p2)(assoc 10 edata) edata) ndata (subst (cons 11 p1)(assoc 11 edata) ndata) ); else (setq ndata (subst (cons 10 p4)(assoc 10 edata) edata) ndata (subst (cons 13 p1)(assoc 13 edata) ndata) ndata (subst (cons 11 p3)(assoc 11 edata) ndata) ndata (subst (cons 12 p2)(assoc 12 edata) ndata) ) );if (entmod ndata) (entupd e) );while (command "_UNDO" "_E") (setvar "CMDECHO" 1) (princ "\nDone. Use _U to revert back (undo).") ));if (princ) )
ACAD
100% *  CAD 
30.1.2013    10280×  
Prices - CAD eShop:
applies to: AutoCAD ·

See also:
Tip 12064:3D offset of a surface.
Tip 11252:Applying STRETCH to 3D objects in AutoCAD.
Tip 11054:Difference volume (3D solid) between two TIN surfaces (sets of coordinates)
Tip 8903:Draw normals of 3DFaces in AutoCAD DWG.
Tip 8597:Flashing, patchy appearance of Revit 3D models in Showcase.


Back   All CAD Tips All CAD tips&tricks



Have we helped you? If you want to support the CAD Forum web service, consider buying one of our CAD applications, or our custom software development offerings, or donating via PayPal (see above). You may also add a link to your web - like this "fan" link: CAD Forum - tips, utilities, blocks for Autodesk products
CAD:    OS:    Categ: 
Text:  FAQ glossary   



Featuring:
Increase your productivity with our set of add-on functions for AutoCAD Civil 3D
CADstudio Civil Tools More info


Please use these tips at your own risk.
CAD Studio is not responsible for possible problems that may occur as a result of using any of these tips.
TOPlist