# Thread: split spline in lowest point

1. ## split spline in lowest point

Could somebody write me a routine which would split a spline in it's lowest point, please?

2. ## Re: split spline in lowest point

Can you explain more in details please ?

Tharwat

3. ## Re: split spline in lowest point

I need to split a parabola like this one (unknown start and end)
into 2 pieces in it's lowest point.

I've been working all day on a somewhat mathematical solution (putting a horizontal line inside of the parabola, then putting a vertical line in the center of the horizontal one and breaking the spline (parabola) in the intersection of the vertical line and the spline).

I was hoping someone with more programming skill could help me with a more elegant solution (one which works on splines of any type)

4. ## Re: split spline in lowest point

Give this a try...

Code:
```(defun c:foo ( / MAXPT MINPT OLDOSMODE PTA SPLINEOBJ VLA-SPLINEOBJ)
(setq splineobj (car (entsel))
vla-splineobj (vlax-ename->vla-object splineobj)
); setq
(vlax-invoke-method vla-splineobj 'getboundingbox 'minpt 'maxpt)
(setq pta (vlax-curve-getclosestpointtoprojection
vla-splineobj
(list 0.0 (- (cadr (vlax-safearray->list minpt)) 10.0) 0.0)
(list 1.0 0.0 0.0)
nil
); vlax-curve-getclosestpointtoprojection
oldosmode (getvar "osmode")
); setq
(setvar "osmode" (boole 7 (getvar "osmode") 16384))
(vl-cmdf "break" splineobj pta pta)
(setvar "osmode" oldosmode)
(princ)
); defun```
Note that it is absolutely bare-bones, with no error handling, and assumes that there is only one "lowest" point on the curve.

5. ## Re: split spline in lowest point

thank you

#### Posting Permissions

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