How to Convert 2D line into 1D line with same length

How to Convert 2D line into 1D line with same length

Anonymous
Not applicable
995 Views
2 Replies
Message 1 of 3

How to Convert 2D line into 1D line with same length

Anonymous
Not applicable

I would like to convert a 2D line into a 1D polyline with the same length. How can I do it, please?

 

 

0 Likes
996 Views
2 Replies
Replies (2)
Message 2 of 3

ennujozlagam
Mentor
Mentor

if it is a spine> then in the command prompt type SPLINEDIT > select convert to polyline. thanks





Remember : without the difficult times in your LIFE, you wouldn't be who you are today. Be grateful for the good and the bad. ANGER doesn't solve anything. It builds nothing, but it can destroy everything...
Please mark this response as "Accept as Solution" if it answers your question. Kudos gladly accepted.
0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

If you mean that you want to Stretch Polylines out Straight, such as to take the red here and make the 1-dimensional yellow equivalent:

SPS.PNG

you can use this that I wrote a while back:

(defun C:SPS (/ ss pl lengths); = Stretch Polyline(s) Straight
  (prompt "\nTo Stretch Polylines out Straight,")
  (if (setq ss (ssget '((0 . "*POLYLINE"))))
    (progn ; 'then'
      (repeat (setq n (sslength ss))
        (setq pl (ssname ss (setq n (1- n))))
        (repeat (setq par (fix (vlax-curve-getEndParam pl)))
          (setq lengths ; list of segment lengths
            (cons
              (- ; length of segment ending at parameter
                (vlax-curve-getDistAtParam pl par)
                (vlax-curve-getDistAtParam pl (setq par (1- par)))
              ); -
              lengths
            ); cons
          ); setq [lengths]
        ); repeat
        (command "_.pline" (vlax-curve-getStartPoint pl))
        (repeat (length lengths); feed segment lengths out to Pline
          (command "_none" (polar (getvar 'lastpoint) 0 (car lengths)))
          (setq lengths (cdr lengths))
        ); repeat
        (command "")
      ); repeat
    ); progn
  ); if
); defun
Kent Cooper, AIA
0 Likes