Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Explode Spline

Status
Not open for further replies.

majora

Industrial
Apr 19, 2006
22
0
0
US
Is it possible to explode a spline contour?? If so, how do I go about doing so. The explode command doesn't work. Thanks for your help in advance.
 
Replies continue below

Recommended for you

This routine will convert a spline into a pline; not exactly though. Thanks to an unknown author
Code:
(defun C:SPLINE2PLINE (/ SPLINES PLINETYPE OSMODE I SPL ED CODEPAIR)
  (if
    (setq SPLINES (ssget (list (cons 0 "spline"))))
     (progn
       (if
         (zerop (setq PLINETYPE (getvar "plinetype")))
          (setvar "plinetype" 1)
          ) ;if
       (setq OSMODE (getvar "osmode"))
       (setvar "osmode" 0)
       (setq I 0)
       (while
         (setq SPL (ssname SPLINES I))
          (setq    I  (1+ I)
                ED (entget SPL)
                ) ;setq
          (command ".pline")
          (foreach
               CODEPAIR
                       ED
            (if
              (= 10 (car CODEPAIR))
               (command (cdr CODEPAIR))
               ) ;if
            ) ;foreach
          (command "")
          (command ".pedit" "l" "s" "")
          ) ;while
       (if PLINETYPE
         (setvar "plinetype" PLINETYPE)
         )
       (setvar "osmode" OSMODE)
       ) ;progn
     ) ;if
  (princ)
  ) ;defun

____________________
Acad2005, Terramodel
 
First copy/paste the above code into Notepad. Save the file as spline2pline.lsp in the support directory of AutoCad.
At the command line type (load"spline2pline") to load the lisp routine. To invoke the command type spline2pline at the command line.

____________________
Acad2005, Terramodel
 
Save a copy of the file before you De-spline, you won't like the results.

Contours should be created using plines and arcs with elevations. You'll agree once you de-spline.

A spline is an approximate depiction of curved path through the actual vertices, pline and arcs are precise paths, from point to a point. What looks like a nice smooth slope now will become a jumble of lines, and be virtually unuseable.

For this project, unfortunately, you are stuck with the splines, which can't be manipulated reliably. You'll have to actually redraw the ones you need to offset or measure the areas. SOME of the vertices MIGHT be on a Z location equal to the elevation, but check carefully.

Engineering is the practice of the art of science - Steve
 
Status
Not open for further replies.
Back
Top