drafting_man Posted April 22, 2011 Share Posted April 22, 2011 (edited) if someone can help me i will be thanks i need lisp can calculate manhole invert level for sewer line i will give the lisp invert level 1 and slope and distance (distance is aligned dimension ) then lisp calculate invert level 2 invert level 2 = invert leverl 1 - distance * slope invert level 3 = invert leverl 2 - distance * slope invert level 4 = invert leverl 3 - distance * slope until i finished slope don't changed only distance changed example attached thanks invert.dwg Edited April 22, 2011 by drafting_man Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 23, 2011 Share Posted April 23, 2011 Check this link out and it might help you out with it . http://www.cadtutor.net/forum/showthread.php?58479-Calculate-Manhole-Gradient&p=396379&viewfull=1#post396379 TharwaT Quote Link to comment Share on other sites More sharing options...
drafting_man Posted April 23, 2011 Author Share Posted April 23, 2011 Check this link out and it might help you out with it . http://www.cadtutor.net/forum/showthread.php?58479-Calculate-Manhole-Gradient&p=396379&viewfull=1#post396379 TharwaT thank's but that was not help for me Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 23, 2011 Share Posted April 23, 2011 thank's but that was not help for me No problem , I guess the routine that you asking for is not that hard to make , so if I had time today I would make it for you . Or may be one of the great friends in here would do it . Regards, TharwaT Quote Link to comment Share on other sites More sharing options...
Organic Posted April 23, 2011 Share Posted April 23, 2011 I would just manually calculate the invert levels. If something goes wrong and the inverts are calculated incorrectly, then that will have flow on effects for other parts of the design. Civil3D and most other civil design packages can do this for you. Although a calcualtor, pen and paper still remains one of the best ways. Quote Link to comment Share on other sites More sharing options...
fixo Posted April 23, 2011 Share Posted April 23, 2011 try this (defun c:demo(/ decs diff elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect starting level text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter slope in decimals <0.03> : ")) (if (not slope) (setq slope 0.03)) (setvar 'osmode 516) (setq p1 (getpoint "\nPick first point: ")) (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick next point (or press Enter to Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) Quote Link to comment Share on other sites More sharing options...
drafting_man Posted April 23, 2011 Author Share Posted April 23, 2011 try this (defun c:demo(/ decs diff elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect starting level text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter slope in decimals <0.03> : ")) (if (not slope) (setq slope 0.03)) (setvar 'osmode 516) (setq p1 (getpoint "\nPick first point: ")) (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick next point (or press Enter to Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) that was great fixo thank's man you make me happy but excuse me small editing if there is small opition to place text manually Quote Link to comment Share on other sites More sharing options...
fixo Posted April 24, 2011 Share Posted April 24, 2011 You might be want to try this one insted (defun c:demo2 (/ decs ;|diff|; elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect starting level text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter slope in decimals <0.004> : ")) (if (not slope) (setq slope 0.004)) (setvar 'osmode 516) (setq p1 (getpoint "\nPick first point: ")) ;;; (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick next point (or press Enter to Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (getpoint "\nPick a text point: "); (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) Quote Link to comment Share on other sites More sharing options...
jason tay Posted April 25, 2011 Share Posted April 25, 2011 fixo , it's really great ! Quote Link to comment Share on other sites More sharing options...
jason tay Posted April 25, 2011 Share Posted April 25, 2011 is that possible the slope not in decimal ? Quote Link to comment Share on other sites More sharing options...
fixo Posted April 25, 2011 Share Posted April 25, 2011 I'm metric.. so maybe you need to use : (rtos level 3 3) or (rtos level 4 3) instead of: (rtos level decs) inside the code Not sure about though Quote Link to comment Share on other sites More sharing options...
jason tay Posted April 25, 2011 Share Posted April 25, 2011 fixo , sorry to make the confuse, i mean the slope shown by the example is 1:250 then we can enter 250 instead of enter 0.004 Quote Link to comment Share on other sites More sharing options...
Organic Posted April 25, 2011 Share Posted April 25, 2011 Try (defun c:demo3 (/ decs ;|diff|; elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect starting level text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter slope ratio (1:X) <250> : ")) (if (not slope) (setq slope 250)) (setq slope (/ 1 slope)) (setvar 'osmode 516) (setq p1 (getpoint "\nPick first point: ")) ;;; (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick next point (or press Enter to Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (getpoint "\nPick a text point: "); (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) Quote Link to comment Share on other sites More sharing options...
jason tay Posted April 25, 2011 Share Posted April 25, 2011 cool~man, Thanks Fixo and Dink ! those lisp is such express for doing invert calculation ! Quote Link to comment Share on other sites More sharing options...
drafting_man Posted April 25, 2011 Author Share Posted April 25, 2011 fixo , it's really great ! fixo thank's man that was wat i want u make all engineer in my office happy with this lisp Quote Link to comment Share on other sites More sharing options...
fixo Posted April 25, 2011 Share Posted April 25, 2011 Happy to help Cheers Quote Link to comment Share on other sites More sharing options...
Afsarghori Posted August 25, 2014 Share Posted August 25, 2014 That's a great job, must be followed by appreciation. could you guide how to use this lsp in steps.......as im electrical, first time time doing plumbing.........and when I started using this lisp didn't understand what to select when LSP is asking to select.........pl. guide step by step Quote Link to comment Share on other sites More sharing options...
eavilad3rd Posted September 28, 2015 Share Posted September 28, 2015 Check this link out and it might help you out with it . http://www.cadtutor.net/forum/showthread.php?58479-Calculate-Manhole-Gradient&p=396379&viewfull=1#post396379 TharwaT sir can you pls help me i just want to make the autoout put to be in % thanks in advance Quote Link to comment Share on other sites More sharing options...
Ajmal Posted May 11, 2020 Share Posted May 11, 2020 (edited) On 24/04/2011 at 13:20, fixo said: You might be want to try this one insted (defun c:demo2 (/ decs ;|diff|; elist level osm p1 p2 slope strlevel txtelev txthgt txtpt) (setq osm (getvar 'osmode)) (while (and (or (not (setq txtelev (entsel "\nSelect starting level text : "))) (not (eq "TEXT" (cdr (assoc 0 (setq elist (entget (car txtelev))))))))) (princ "\n Nothing selected or wrong object type selected, try again") ) (setq strlevel (cdr (assoc 1 elist)) decs (- (strlen strlevel) (1+ (vl-string-position 46 strlevel))) level (atof strlevel) txthgt (cdr (assoc 40 elist)) ) (initget 6) (setq slope (getreal "\n Enter slope in decimals <0.004> : ")) (if (not slope) (setq slope 0.004)) (setvar 'osmode 516) (setq p1 (getpoint "\nPick first point: ")) ;;; (setq diff (mapcar '- (cdr (assoc 10 elist)) p1)) (while (setq p2 (getpoint "\nPick next point (or press Enter to Exit): ")) (setq level (- level (* (distance p1 p2) slope)) strlevel (rtos level decs) txtpt (getpoint "\nPick a text point: "); (mapcar '+ p2 diff) ) (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") '(100 . "AcDbText") (cons 10 txtpt) (cons 11 (list 0.0 0.0 0.0)) (cons 40 txthgt) (cons 1 strlevel) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) '(7 . "Standard") '(71 . 0) '(72 . 0) (cons 210 (list 0.0 0.0 1.0)) '(73 . 0)) ) (setq p1 p2) ) (setvar 'osmode osm) (princ) ) how can i change to mm round with 5 (like 3065) Edited May 11, 2020 by Ajmal Quote Link to comment Share on other sites More sharing options...
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.