3d face

3d face

Anonymous
Not applicable
1,461 Views
6 Replies
Message 1 of 7

3d face

Anonymous
Not applicable

Dear Sir, I have some X sections made by civil3D. then I want make some corrections by the help of Autocad 2013. There is one problem for editing. Almost 75% lines is 3dface line. I want to convert to 2d poly line. Please help me for converting.

0 Likes
1,462 Views
6 Replies
Replies (6)
Message 2 of 7

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

.... Almost 75% lines is 3dface line. I want to convert to 2d poly line. Please help me for converting.


Some 3DFaces will not be able to be converted to 2D Polylines with the same shape, because the former can be warped, but the latter cannot.  Unless your 3DFaces are all planar, or you want to change any that are not so that they are, you would need to convert them to 3DPolylines, or convert their edges into Lines.  Here is a routine that will convert all visible edges of 3DFaces to Lines.  It could probably be adjusted easily enough to turn 3DFaces into 3DPolylines, if you don't ming losing all edge invisibility.

Kent Cooper, AIA
0 Likes
Message 3 of 7

stevor
Collaborator
Collaborator

Here is a start:

 

 
 (DeFun W_U (p) (if (Pnt_P p) (trans p 0 1))) ; WorLd to Ucs
 (defun Dxf_ (n dL) (cdr (assoc n dL ) ) )
 (defun exit_s ( s )(princ"\n Exit: ") (princ s) (exit))
 
 ; planar 3DFace entname to LWPolyline, w/ DXF_ W_U EXIT_S AusCadd.com
 (defun 3DF_Pline ( FEN / VLW VLU P1 P2 P3 P0 FDL P REN PEN)
  (if (="3DFACE" (Dxf_ 0 (setq FDL (entget FEN) )))
   (progn
    (setq P0 (DXF_ 10 FDL)  P1 (DXF_ 11 FDL)  
          P2 (DXF_ 12 FDL)  P3 (DXF_ 13 FDL) )
    (setq VLW (if P3  (LIST P0 P1 P2 P3 )
      (if P2 (LIST P0 P1 P2) (EXIT_S " NO P2 "))))
    (setq VLU (MAPCAR 'W_U VLW)) ; World to User
    (command "UCS" "3" (car VLU)  (cadr VLU)  (caddr VLU)  )
    (setq VLU (MAPCAR 'W_U VLW)) ; World to User again
    (princ ", pline: ")  (setq ren (entlast))
    (command "PLINE") (foreach P VLu (command P)) (command "c")
    (command "UCS" "p") (setq pen (entlast))
    (if (and pen (or (not ren) (not (eq ren pen)))) pen)  
  ))  
 )

 

 Add you entity selection proecsses.

 

 For non-planar 3DFaces, more code:

split the 4 corner face into 2 3 corner plines.

 

S
0 Likes
Message 4 of 7

Kent1Cooper
Consultant
Consultant

@Kent1Cooper wrote:
....  Here is a routine that will convert all visible edges of 3DFaces to Lines.  It could probably be adjusted easily enough to turn 3DFaces into 3DPolylines, if you don't ming losing all edge invisibility.


Here's a routine to do that, edited from the one in that link.  There are several benefits to making 3DPolylines instead of 2D.  Since 3DFaces can never have curved edges or width, you don't need the availability of those characteristics that 2D Polylines offer.  And since the vertices of 3Dfaces are stored in World Coordinates, regardless of in what other UCS they may have been drawn, if you convert to 3DPolylines instead of 2D, there's no need to check whether they lie in a flat plane, nor what plane that is, nor change the UCS to match it, nor lose the warp in any that are warped, nor subdivide warped ones into two triangles in order to be able to duplicate them with 2D Polylines.

Kent Cooper, AIA
0 Likes
Message 5 of 7

Anonymous
Not applicable

Thanks... some lines I cannot edit with this lisp.

0 Likes
Message 6 of 7

hmsilva
Mentor
Mentor

Hi anaskattayil,


in your first post you have stated:


'There is one problem for editing. Almost 75% lines is 3dface line. I want to convert to 2d poly line.'


with '2d poly' do you mean lwpolylines with Z=0.0???

 

'... some lines I cannot edit with this lisp.'

 

Kent1Cooper's code only process 'unlocked 3DFaces', try to unlock all layers before run the code.

And if even so you can't process 'those lines', post a sample dwg with afew of 'those lines'


Henrique

EESignature

0 Likes
Message 7 of 7

Anonymous
Not applicable

I re started my computer & its ok now..... Thanks Alot.

0 Likes