Jump to content

calculate manhole invert level


drafting_man

Recommended Posts

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 by drafting_man
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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)
 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
 )

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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)
 )

Link to comment
Share on other sites

fixo , it's really great :D !

 

fixo thank's man that was wat i want

u make all engineer in my office happy with this lisp

Link to comment
Share on other sites

  • 3 years later...

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

Link to comment
Share on other sites

  • 1 year later...
  • 4 years later...
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 by Ajmal
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...