121madhu Posted August 27, 2013 Posted August 27, 2013 INVERT LEVEL:- (Enter First IL – Enter Second IL /Enter distance*Enter distance of new IL) ± Enter Invert Level First or Second. First IL=657.922 Second IL=657.672 Distance=50 (657.922-657.672/50)*25 =(0.25/50)*25 =0.005*25 = 0.125 =0.125+657.547 = 657.672 Quote
Organic Posted August 27, 2013 Posted August 27, 2013 You might need to provide additional details, what you have there is hard to follow. Quote
121madhu Posted August 28, 2013 Author Posted August 28, 2013 check this jpg i have only one level so calculating this any lisp have please suggest me Quote
BIGAL Posted August 28, 2013 Posted August 28, 2013 The best way would be to draw manholes at exact location then enter slope or rise/fall this way it works out the correct answers. Pick first manhole and enter invert and slope, pick next manhole, invert label will appear based on some rule re angle of two points. Is this what you want ? Quote
121madhu Posted August 28, 2013 Author Posted August 28, 2013 i am looking for lisp selecting two levels calculate then i pick a point then give value example see jpeg first i know two points one 657.547 and second 657.922 Quote
hmsilva Posted August 28, 2013 Posted August 28, 2013 Your dwg has Z values? Do you intend to select the TEXT or the POINT entity? In your image the POINT and TEXT, are two separate entities or a block? Do you intend to calculate always straight, or with curves? There are too many questions, the best way to manage to get help, is helping us, attaching a sample drawing with what you have and what you intend to get... Henrique Quote
121madhu Posted August 28, 2013 Author Posted August 28, 2013 only X,Y no blocks only select text then pick next distence point then give value (sorry for my poor english excuse me) Quote
hmsilva Posted August 28, 2013 Posted August 28, 2013 only X,Yno blocks only select text then pick next distence point then give value (sorry for my poor english excuse me) A quick and dirty one, works in WCS only... Try it... (defun c:test (/ PT1 PT1Z PT2 PT2Z PT3 PT3Z S1 S2 TX1 TX2) (if (and (not (Prompt "\nSelect first reference TEXT: ")) (setq s1 (ssget "+.:L:S" '((0 . "TEXT")))) (not (Prompt "\nSelect second reference TEXT: ")) (setq s2 (ssget "+.:L:S" '((0 . "TEXT")))) (setq pt3 (getpoint "\nPick point to calculate elevation: ")) );; and (progn (setq tx1 (entget (ssname s1 0)) pt1 (cdr (assoc 11 tx1)) pt1z (atof (cdr (assoc 1 tx1))) tx2 (entget (ssname s2 0)) pt2 (cdr (assoc 11 tx2)) pt2z (atof (cdr (assoc 1 tx2))) pt3z (+ (/ (* (distance pt1 pt3) (- pt2z pt1z)) (distance pt1 pt2)) pt1z) );; setq (entmake (list '(0 . "TEXT") '(100 . "AcDbEntity") (assoc 8 tx1) '(100 . "AcDbText") '(10 0.0 0.0 0.0) (assoc 40 tx1) (cons 1 (rtos pt3z)) '(50 . 0.0) '(41 . 1.0) '(51 . 0.0) (assoc 7 tx1) '(71 . 0) '(72 . 2) (cons 11 pt3) '(210 0.0 0.0 1.0) '(73 . 1) );; list );; entmake );; progn );; if );; test Henrique Quote
121madhu Posted August 29, 2013 Author Posted August 29, 2013 Thank you hmsilva Look this lisp calculate level this is ok but I need same formula but I pick the point where I need to calculate paste insert text continues this lisp giving only one time prompt window I want click next point where distance then continues click then give value click then give value ;;; Calculate grade of unknown point ;;; (defun c:GRADE (/ #Dist #Elev #Grade #NewElev) (cond ((and (setq #Dist (getdist "\nDistance: ")) (setq #Elev (getreal "\nElevation of known point: ")) (setq #Grade (getreal "\nPercent grade (eg: 0.25 for 0.25%): ")) ) ;_ and (setq #NewElev (strcat "\nElevation: " (rtos (+ (* #Dist (/ #Grade 100)) #Elev) 2 3) ) ;_ strcat ) ;_ setq (princ #NewElev) (alert #NewElev) ) ) ;_ cond (princ) ) ;_ defun 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.