Results 1 to 5 of 5

Thread: split spline in lowest point

  1. #1
    Member
    Join Date
    2012-03
    Posts
    3

    Default split spline in lowest point

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

  2. #2
    I could stop if I wanted to Tharwat's Avatar
    Join Date
    2010-06
    Posts
    483

    Default Re: split spline in lowest point

    Can you explain more in details please ?

    Tharwat

  3. #3
    Member
    Join Date
    2012-03
    Posts
    3

    Default Re: split spline in lowest point

    I need to split a parabola like this one (unknown start and end)
    http://www.google.hr/imgres?start=24...13,s:247,i:204
    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. #4
    Active Member
    Join Date
    2000-11
    Location
    Ontario, Canada
    Posts
    84

    Default 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. #5
    Member
    Join Date
    2012-03
    Posts
    3

    Default Re: split spline in lowest point

    thank you

Similar Threads

  1. Generic model hosted by lowest level when copied/arrayed
    By patricks in forum Revit Architecture - General
    Replies: 0
    Last Post: 2012-03-23, 03:12 PM
  2. Combine Surfaces-Use lowest elevation
    By epipkin in forum AutoCAD Civil 3D - Surfaces
    Replies: 2
    Last Post: 2010-08-05, 04:47 PM
  3. Lowest Wall Height
    By ford347 in forum Revit Architecture - General
    Replies: 2
    Last Post: 2009-07-27, 07:56 PM
  4. Lowest of two surfaces
    By joao.nuncio in forum AutoCAD Civil 3D - Surfaces
    Replies: 7
    Last Post: 2009-04-08, 03:09 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
  •