ymg3 Posted January 18, 2014 Posted January 18, 2014 (edited) suriwaits, Right now we are minimizing the amplitude of the overspray/underspray. What if we factor in the number of Heads and we choose based on the minimum (Nb of heads * overpray) This way we would favour bigger heads, specially when the oversprays are close together and still have a continuous function over the range. I have not analyzed your last post. will look at it. (/ 5 2) -> 2 equivalent to your QUOTIENT function (rem 5 2)-> 1 equivalent to your MOD function Modified code to factor in the Number of heads: (defun round (x) (if (>= (- x (fix x)) 0.5) (1+ (fix x)) (fix x))) (defun dtr (a) (* pi (/ a 180.0))) (defun rtd (a) (/ (* a 180.0) pi)) ;;; listpol by Gille Chanteau ; ;;; Returns the vertices list of any type of polyline (WCS coordinates) ; ;;; ; ;;; Argument ; ;;; en, a polyline (ename or vla-object) ; (defun listpol (en / i p l) (setq i (+ (vlax-curve-getEndParam en) (if (vlax-curve-IsClosed en) 1 0))) (while (setq p (vlax-curve-getPointAtParam en (setq i (1- i)))) (setq l (cons (trans p 0 1 ) l)) ) ) ;; sprktyp ; ;; ; ;; Argument: d Length of Side To Install Sprinklers. ; ;; Return: A list (Spacing "Type" HDnum Overspray) ; (defun sprktyp (d / hdnum hdtyp head headl ovspr ovtmp radius rtn) (setq headl '((4.572 . "15-180")(3.658 . "12-180")(3.048 . "10-180")) ovspr 99999 ) (foreach head headl (setq radius (car head) hdtyp (cdr head) hdnum (round (/ d radius)) ovtmp (* (abs (- (* hdnum radius) d)) hdnum) spacing (/ d hdnum) ) (if (< ovtmp ovspr) (setq ovspr ovtmp rtn (list spacing hdtyp hdnum (/ ovspr hdnum)) ) ) ) rtn ) (defun c:spr ( / a cb d d1 d2 enl n oldsnap p1 s1b s2b ss) (setq oldsnap (getvar 'OSMODE)) (setvar 'OSMODE 0) (prompt "\nSelect The Zone To Cover With Sprinklers:") (if (setq ss (ssget "_:S" '((-4 . "<or")(0 . "*POLYLINE")(0 . "CIRCLE")(-4 . "or>")))) (progn (setq enl (entget (ssname ss 0))) (cond ((= (cdr (assoc 0 enl)) "CIRCLE") (setq pc (cdr (assoc 10 enl)) rd (cdr (assoc 40 enl)) perim (* 2 pi rd) typ (sprktyp perim) ang (/ (* 2 pi) (caddr typ)) p1 (polar pc 0 rd) a 0 ) (repeat (caddr typ) (vl-cmdf "_INSERT" (cadr typ) (polar pc a rd) "" "" (+ (rtd a) 90)) (setq a (+ a ang)) ) ) (t (setq pl (listpol (ssname ss 0)) p1 (car pl) pl (cdr pl) d1 (distance p1 (car pl)) d2 (distance (car pl) (cadr pl)) s1b (sprktyp d1) s2b (sprktyp d2) cb (strcat (itoa (max (atoi (cadr s1b)) (atoi (cadr s2b)))) "-90") ) (repeat 2 (vl-cmdf "_INSERT" cb p1 "" "" (rtd (setq a (angle p1 (car pl))))) (setq n 1) (while (< (setq d (* n (car s1b))) d1) (vl-cmdf "_INSERT" (cadr s1b) (polar p1 a d) "" "" (rtd a)) (setq n (1+ n)) ) (setq p1 (car pl) pl (cdr pl)) (vl-cmdf "_INSERT" cb p1 "" "" (rtd (setq a (angle p1 (car pl))))) (setq n 1) (while (< (setq d (* n (car s2b))) d2) (vl-cmdf "_INSERT" (cadr s2b) (polar p1 a d) "" "" (rtd a)) (setq n (1+ n)) ) (setq p1 (car pl) pl (cdr pl)) ) ) ) ) ) (setvar 'OSMODE oldsnap) (princ) ) (defun c:test (/ d typ) (setq d 7.0) (textscr) (princ "\nD \tSpc\tTYP\tHD#\t OVSpray") (while (< d 40.1) (setq typ (sprktyp d)) (princ (strcat "\n" (rtos d 2 1) "\t" (rtos (car typ) 2 2) "\t" (cadr typ) "\t" (itoa (caddr typ)) "\t" (rtos (cadddr typ) 2 2))) (setq d (+ d 0.1)) ) (princ) ) ymg Edited January 18, 2014 by ymg3 Added Code to Factored in Nb of Heads. Quote
suriwaits Posted January 19, 2014 Author Posted January 19, 2014 (edited) suriwaits, Right now we are minimizing the amplitude of the overspray/underspray. What if we factor in the number of Heads and we choose based on the minimum (Nb of heads * overpray) ymg Excellent YMG. you are great . Is there any possiblility to select same series sprinklers?. eg. if one side 15-180 is the best fit for one side, other side 10-180 is the best fit, code to use 10-180(smaller of both) on both sides. This will be very usefull for me when designing lenghty x narrow strip(like 3mx40m). If it is too complicated kindly leave as it is. Thanks. Suriwaits. Edited January 19, 2014 by suriwaits Quote
ymg3 Posted January 19, 2014 Posted January 19, 2014 suriwaits, Is there any possiblility to select same series sprinklers?. Not difficult, but the question is, Do you want this behaviour all the times or only when you have long thin strip?? ymg Quote
ymg3 Posted January 20, 2014 Posted January 20, 2014 (edited) Pending that you give me a reply for the long strip, I've added a subroutine by ElpanovEvgeniy to check the direction that the rectangle is drawn. So with this you can draw it any direction. In the attached drawing, I've added Spray Patterns to your block. Added a command to the routine, TSP toggles the layer for the Spray Pattern ON/OFF. ymg (defun round (x) (if (>= (- x (fix x)) 0.5) (1+ (fix x)) (fix x))) (defun dtr (a) (* pi (/ a 180.0))) (defun rtd (a) (/ (* a 180.0) pi)) ;; by ElpanovEvgeniy ; ;; Checks Direction of a Polyline ; ;; Returns T if Clockwise, nil Counterclockwise. ; (defun ispolycw_p (lw / lst maxp minp) (setq lw (vlax-ename->vla-object lw)) (vla-GetBoundingBox lw 'MinP 'MaxP) (setq minp (vlax-safearray->list minp) MaxP (vlax-safearray->list MaxP) lst (mapcar (function (lambda (x) (vlax-curve-getParamAtPoint lw (vlax-curve-getClosestPointTo lw x)))) (list minp (list (car minp) (cadr MaxP)) MaxP (list (car MaxP) (cadr minp))) ) ) (if (or (<= (car lst) (cadr lst) (caddr lst) (cadddr lst)) (<= (cadr lst) (caddr lst) (cadddr lst) (car lst)) (<= (caddr lst) (cadddr lst) (car lst) (cadr lst)) (<= (cadddr lst) (car lst) (cadr lst) (caddr lst)) ) t ) ) ;;; listpol by Gille Chanteau ; ;;; Returns the vertices list of any type of polyline (WCS coordinates) ; ;;; ; ;;; Argument ; ;;; en, a polyline (ename or vla-object) ; (defun listpol (en / i p l) (setq i (+ (vlax-curve-getEndParam en) (if (vlax-curve-IsClosed en) 1 0))) (while (setq p (vlax-curve-getPointAtParam en (setq i (1- i)))) (setq l (cons (trans p 0 1 ) l)) ) ) ;; sprktyp ; ;; ; ;; Argument: d Length of Side To Install Sprinklers. ; ;; Return: A list (Spacing "Type" HDnum Overspray) ; (defun sprktyp (d / hdnum hdtyp head headl ovspr ovtmp radius rtn) (setq headl '((4.572 . "15-180")(3.658 . "12-180")(3.048 . "10-180")) ovspr 99999 ) (foreach head headl (setq radius (car head) hdtyp (cdr head) hdnum (round (/ d radius)) ovtmp (* (abs (- (* hdnum radius) d)) hdnum) spacing (/ d hdnum) ) (if (< ovtmp ovspr) (setq ovspr ovtmp rtn (list spacing hdtyp hdnum (/ ovspr hdnum)) ) ) ) rtn ) (defun c:spr ( / a cb d d1 d2 enl n oldsnap p1 pl s1b s2b ss) (setq oldsnap (getvar 'OSMODE)) (setvar 'OSMODE 0) (prompt "\nSelect The Zone To Cover With Sprinklers:") (if (setq ss (ssget "_:S" '((-4 . "<or")(0 . "*POLYLINE")(0 . "CIRCLE")(-4 . "or>")))) (progn (setq enl (entget (ssname ss 0))) (cond ((= (cdr (assoc 0 enl)) "CIRCLE") (setq pc (cdr (assoc 10 enl)) rd (cdr (assoc 40 enl)) perim (* 2 pi rd) typ (sprktyp perim) ang (/ (* 2 pi) (caddr typ)) p1 (polar pc 0 rd) a 0 ) (repeat (caddr typ) (vl-cmdf "_INSERT" (cadr typ) (polar pc a rd) "" "" (+ (rtd a) 90)) (setq a (+ a ang)) ) ) (t (setq pl (listpol (ssname ss 0)) pl (if (ispolycw_p (ssname ss 0)) (reverse pl) pl) p1 (car pl) pl (cdr pl) d1 (distance p1 (car pl)) d2 (distance (car pl) (cadr pl)) s1b (sprktyp d1) s2b (sprktyp d2) cb (strcat (itoa (max (atoi (cadr s1b)) (atoi (cadr s2b)))) "-90") ) (repeat 2 (vl-cmdf "_INSERT" cb p1 "" "" (rtd (setq a (angle p1 (car pl))))) (setq n 1) (while (< (setq d (* n (car s1b))) d1) (vl-cmdf "_INSERT" (cadr s1b) (polar p1 a d) "" "" (rtd a)) (setq n (1+ n)) ) (setq p1 (car pl) pl (cdr pl)) (vl-cmdf "_INSERT" cb p1 "" "" (rtd (setq a (angle p1 (car pl))))) (setq n 1) (while (< (setq d (* n (car s2b))) d2) (vl-cmdf "_INSERT" (cadr s2b) (polar p1 a d) "" "" (rtd a)) (setq n (1+ n)) ) (setq p1 (car pl) pl (cdr pl)) ) ) ) ) ) (setvar 'OSMODE oldsnap) (princ) ) (defun c:tsp (/ ent) (if (tblobjname "LAYER" "Spray Pattern") (progn (setq ent (entget (tblobjname "LAYER" "Spray Pattern"))) (entmod (subst (cons 62 (- (cdr (assoc 62 ent)))) (assoc 62 ent) ent)) ) ) ) (defun c:test (/ d typ) (setq d 7.0) (textscr) (princ "\nD \tSpc\tTYP\tHD#\t OVSpray") (while (< d 40.1) (setq typ (sprktyp d)) (princ (strcat "\n" (rtos d 2 1) "\t" (rtos (car typ) 2 2) "\t" (cadr typ) "\t" (itoa (caddr typ)) "\t" (rtos (cadddr typ) 2 2))) (setq d (+ d 0.1)) ) (princ) ) sprinkler.dwg Edited January 20, 2014 by ymg3 Quote
suriwaits Posted January 20, 2014 Author Posted January 20, 2014 (edited) I've added a subroutine by ElpanovEvgeniy to check the direction that the rectangle is drawn. So with this you can draw it any direction. ymg Thanks. Works on all the rectangles irrespective of direction. Not difficult, but the question is, Do you want this behaviour all the times or only when you have long thin strip?? ymg Yes, for all the time Right now we are minimizing the amplitude of the overspray/underspray. What if we factor in the number of Heads and we choose based on the minimum (Nb of heads * overpray) This way we would favour bigger heads, specially when the oversprays are close together and still have a continuous function over the range. i feel some range are still not matching with my requirement. Instead of checking three different types spray at the same, it is better to check with higher config first and then next smaller and on like i said in #40. First set radius1=3.7, radius 2=3.10,radius3=2.5 hdnum (round (/ d radius1)) remi (rem (d radius1)) (newradius (+ hdnum (/ remi hdnum)) if newradius is Could you please try this way. Thanks a lot again. Suriwaits. Edited January 20, 2014 by suriwaits Quote
ymg3 Posted January 20, 2014 Posted January 20, 2014 (edited) suriwaits, Seems like we are having difficulties communicating the design criteria. So I went to the litterature. Here is an a quotation on what seems to be Industry Standards. DESIGN CRITERIA AND CONSIDERATIONS The water discharged from a single sprinkler is not uniformly distributed over the entire area; a greater quantity falls near the sprinkler and less in the periphery. To ensure a uniform precipitation over the entire area under irrigation, the sprinklers are always placed so that they overlap each other from both directions. This setting is termed sprinkler spacing. The spacing of the sprinklers along the lateral lines is known as SL, and the spacing between two lines as Sm. The spacing pattern is square, rectangular or triangular, with SL = Sm. In order to obtain good distribution uniformity by overlapping, the sprinkler spacing (Sm) should not exceed 65 percent of the sprinkler diameter coverage under light to moderate wind conditions in the square and rectangular patterns. In the triangular pattern, the spacing can be extended up to 70 percent of the diameter coverage. In strong wind conditions, the spacing should be 50 percent of the diameter coverage with the lateral direction perpendicular to the wind direction. With a wind strength of over 3.5 m/s, sprinkling is not recommended. Edited January 20, 2014 by ymg3 Quote
suriwaits Posted January 20, 2014 Author Posted January 20, 2014 (edited) suriwaits, Seems like we are having difficulties communicating the design criteria. So I went to the litterature. Here is an a quotation on what seems to be Industry Standards. You can refer Rainbird website if you are interested to know further on this. I use square spacing with 50% of diameter. Design pressure is 2.1bar for the sprayesr Rainbird MPR Series nozzle 15 series will give max radius of 4.5m@2.1bar, this can be reduced to 25%. likewise 12series - max 3.7m radius@2.1bar. 10 series will give 3.1m@2.1bar. So far, we are trying to fix to Corner and Half Circle sprinklers. I can use Lee's Grid tool to fix to full circle sprinklers if required. Edited May 10, 2014 by suriwaits Quote
anupmadhu Posted September 14, 2015 Posted September 14, 2015 Any options to make this work for irregular areas Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.