Converting multiple 3D polylines to surfaces

Converting multiple 3D polylines to surfaces

Haider_of_Sweden
Collaborator Collaborator
5,539 Views
21 Replies
Message 1 of 22

Converting multiple 3D polylines to surfaces

Haider_of_Sweden
Collaborator
Collaborator

Hello!

 

I have a large amount of 3d polylines I achieved from a shapefile. Provided, you find a sample of how it could look like.

If I want to turn all polylines to surfaces, a manual workflow would be very tedious.

 

This is how the manual process looks like

 

  • SURFPATCH
  • CU - enter
  • Pick a 3d polyline - enter
  • enter, to accept the patch surface
  • Change the surface U/V isolines to 0

 

The limitation with the current tool is that I cannot select multiple polylines.

Therefore a LISP or equal could run that work-flow mentioned above, individually for every single polyline in a selection.

 

If anyone could help, I would be very grateful.

Thanks in advance!

0 Likes
Accepted solutions (1)
5,540 Views
21 Replies
Replies (21)
Message 21 of 22

marko_ribar
Advisor
Advisor

 


@DANIELE.BUCCOLIERI wrote:

Great work... 

I have several 3dpoly very near each other (like PV modules). The lisp routine works something weird... It converts exactly half the 3dpoly selected, in a random way. 

Anyone could please help ?

BESTS

 


 

(defun c:doit ( / *error* cmd suu suv ss i e )

  (vl-load-com)

  (defun *error* ( m )
    (if command-s
      (command-s "_.UNDO" "_E")
      (vl-cmdf "_.UNDO" "_E")
    )
    (if suu
      (setvar (quote surfu) suu)
    )
    (if suv
      (setvar (quote surfv) suv)
    )
    (if cmd
      (setvar (quote cmdecho) cmd)
    )
    (if m
      (prompt m)
    )
    (princ)
  )

  (setq cmd (getvar (quote cmdecho)))
  (setvar (quote cmdecho) 0)
  (if (= 8 (logand 8 (getvar (quote undoctl))))
    (if command-s
      (command-s "_.UNDO" "_E")
      (vl-cmdf "_.UNDO" "_E")
    )
  )
  (if command-s
    (command-s "_.UNDO" "_G")
    (vl-cmdf "_.UNDO" "_G")
  )
  (setq suu (getvar (quote surfu)))
  (setvar (quote surfu) 0)
  (setq suv (getvar (quote surfv)))
  (setvar (quote surfv) 0)
  (if (setq ss (ssget (list (cons 0 "*POLYLINE,SPLINE,ELLIPSE,CIRCLE"))))
    (repeat (setq i (sslength ss))
      (setq e (ssname ss (setq i (1- i))))
      (if (vlax-curve-isclosed e)
        (if command-s
          (command-s "_.SURFPATCH" "" e "" "")
          (vl-cmdf "_.SURFPATCH" "" e "" "")
        )
      )
    )
  )
  (*error* nil)
)

 

 

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 22 of 22

DANIELE.BUCCOLIERI
Community Visitor
Community Visitor

@marko_ribar 

that's GREAT !!!!

It is working... even faster... It looks like magic..

Thanks very much.

 

0 Likes