See the top rated post in this thread. Click here

Results 1 to 8 of 8

Thread: How to convert any spline to pline?

  1. #1
    Member
    Join Date
    2007-08
    Posts
    6
    Login to Give a bone
    0

    Default How to convert any spline to pline?

    How to convert any spline to pline? Anyone can help me? Thanks very much in advanced.

  2. #2
    I could stop if I wanted to
    Join Date
    2003-11
    Posts
    277
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?

    Hi ttaahhhh,
    Test this code
    Code:
    (defun massoc (key alist / x nlist)          ; Jaysen Long
      (foreach x alist
        (if
          (eq key (car x))
          (setq nlist (cons (cdr x) nlist))
        )
      )
      (reverse nlist)
    )
    
    
    (defun c:test (/ cmt len sp ss sse)
      (if
        (setq ss (car (entsel "\nSelect an object spline")))
        (progn
          (setq sse (entget ss))
          (setq sp (massoc 10 sse))
          (setq len (length sp))
          (setq cmt 0)
          (repeat
    	len
    	(command "_pline" (nth cmt sp)(nth (1+ cmt) sp) "")
    	(setq cmt (1+ cmt))
    	) ; repeat
          (command "_erase" ss "")
          )   ; progn
        (alert "\nInvalid selected object,try again")
        )     ; if
      (princ)
      )
    Quote Originally Posted by ttaahhhh View Post
    How to convert any spline to pline? Anyone can help me? Thanks very much in advanced.

  3. #3
    I could stop if I wanted to
    Join Date
    2005-06
    Location
    CORDOBA-ARGENTINA
    Posts
    276
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?

    Other way to do .

    Code:
    (defun C:spltopl ()
     (while (not (and
                  (setq lstSelection   (entsel "\nSelect Spline: "))
                  (setq sngSegment     (getdist "\nGet Segment Length: "))
                  (setq objSelection   (vlax-ename->vla-object (car
    lstSelection)))
                  (wcmatch (vla-get-objectname objSelection) 
     
    "AcDb2dPolyline,AcDbPolyline,AcDbLine,AcDbArc,AcDbSpline"
                  )
                 )
            )
      (princ "\nError please select again: ")
     )
     (setq sngLength   (vlax-curve-getDIstAtParam objSelection
                        (vlax-curve-getEndParam objSelection)
                       )
           sngDistance 0.0
     )
     (vl-cmdf "._pline" (vlax-curve-getpointatDist objSelection 0.0))  (repeat (fix (/ sngLength sngSegment))
      (vl-cmdf (vlax-curve-getpointatDist objSelection sngDistance))
      (setq sngDistance (+ sngDistance sngSegment))
     )
     (vl-cmdf (vlax-curve-getPointAtParam objSelection
               (vlax-curve-getEndParam objSelection)
              )
              ""
     )
    )
    Last edited by Opie; 2007-08-27 at 02:42 PM. Reason: [CODE] tags added

  4. #4
    Member
    Join Date
    2007-08
    Posts
    6
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?


  5. #5
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    470
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?

    You could use explode on the spline, and pedit to join all segments.

  6. #6
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    1

    Default Re: How to convert any spline to pline?

    Quote Originally Posted by aaronic_abacus View Post
    You could use explode on the spline, and pedit to join all segments.
    you cant explode a spline. but you can use the express tool flatten, and it will convert it with out a problem.

  7. #7
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    470
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?

    oops, I was looking at a polyline with spline applied by pedit and not one made with the spline command.
    I wonder what the diiference is between the two.

  8. #8
    Active Member
    Join Date
    2007-03
    Posts
    57
    Login to Give a bone
    0

    Default Re: How to convert any spline to pline?


Similar Threads

  1. Spline to Pline or Lines
    By CADdancer in forum AutoLISP
    Replies: 6
    Last Post: 2013-07-26, 12:41 PM
  2. Convert a spline to a pline
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 3
    Last Post: 2012-07-18, 02:53 AM
  3. PLINE to Spline
    By vijaybaskergundla in forum VBA/COM Interop
    Replies: 6
    Last Post: 2008-09-06, 10:05 AM
  4. Spline to Pline
    By csiress in forum AutoLISP
    Replies: 7
    Last Post: 2007-11-17, 02:57 AM
  5. spline to pline
    By ftjaa in forum AutoCAD General
    Replies: 14
    Last Post: 2005-02-18, 02:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •