Author Topic: Engineering Site Grading question  (Read 15120 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« on: March 17, 2005, 07:29:05 PM »
Gotta a good question!

When designers on a site design a site and need to calc spot elevations at top of curb bottom of curb, side walks, building Finish floors... They usually need to carry the Fin Floor elev through out of the rest of the site.

would it make it sense to have a lsp or something which can calc the grade for you?

ex.

input fin floor elev. = 800.00

asks what slope. = -2%

then asks the starting point and a ending point for a distance

then places a spot elevation at the second point of where you got the distance to show you what the spot elevation is


does this make sense? or is there another easier idea?

thanks!!!!!!!!!!
Civil3D 2020

CarlB

  • Guest
Engineering Site Grading question
« Reply #1 on: March 18, 2005, 02:41:18 AM »
Yes a routine like that might be helpful in setting elevations in a uniformly graded area.  But when using automation be careful not to abandon critical thinking.  Such as - what is drop from FF to adjacent grade (different at doorways and landscaped areas), drop at edge sidewalk (6" approx), the slope away from building different than slope along building so a constant grade applies only in one direction, etc......

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« Reply #2 on: March 18, 2005, 06:27:40 PM »
is this possible?
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Engineering Site Grading question
« Reply #3 on: March 18, 2005, 08:00:58 PM »
Quote from: MSTG007
is this possible?

Yes it is very easy.
But as Carl pointed out the user has to be careful how it is applied.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADaver

  • Guest
Engineering Site Grading question
« Reply #4 on: March 19, 2005, 08:43:09 AM »
I have a little slope calculator I wrote a long time ago that will calc elevations based on a starting elevation and the percent slope and multiple selection points.  I use it for underground pipe calcs, but it'll work on uniformly sloped grades as well.

Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Slope calculator  V2.3, 1987, '88, '90, '92, '94
;; by RBCulp - Falcon Design Services, Inc.
;;
;; NO RIGHTS RESERVED; Any and all content may reproduced by any method on any medium for any reason.
;; Please, feel free to use any part found useful, interesting, enlightening or entertaining.
;; If by some chance, someone wishes to be credited for this, go right ahead.
;;
;; Falcon Design Services (FDS) provides this program "as is" and with all faults.
;; FDS specifically disclaims any implied warranty of merchantability or fitness for a particular use.  
;; FDS does not warrant that the operation of the program will be uninterrupted or error free.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:slcalc ()
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Set defaults on first use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (= stelev nil)  (setq stelev 1200.00))
(if (= endelev nil) (setq endelev 1188.00))
(if (= slope nil)   (setq slope -0.002))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Slope Calculator based on Percent Slope
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun slcalcs ( / nstelev nslope distm dist1 nxtelev firstpt PT1 PT2)
     (if (setq nstelev (getdist (strcat "Enter Starting Elevation <" (RTOS stelev) ">: ")))
(setq stelev nstelev)
     )
     (if (setq nslope (getreal (strcat "Enter Slope Factor (Negative For Down) <" (RTOS slope 2 8) ">: ")))
(setq slope nslope)
     )
      (setq FIRSTPT (getpoint "Pick point ")
   PT2 (getpoint FIRSTPT "\nNext point ")
   distm (distance firstpt pt2)
   nxtelev (+ (* distm slope) stelev)
      )
    (princ (strcat "\n                        Distance is  " (rtos (distance firstpt pt2))))
    (princ (strcat "\n                           Slope is  " (rtos (* distm slope))))
    (princ (strcat "\n                       Elevation is  " (rtos nxtelev)))
    (princ (strcat "\n                       Elevation is  " (rtos (/ nxtelev 12.0) 2 2)"'"))
      (while (/= PT2 nil)
(setq PT1 PT2)
(setq PT2 (getpoint PT1 "\n\nNext point "))
(if (/= PT2 nil)
 (progn
   (setq dist1 (distance pt1 pt2)
 distm (+ distm dist1)
 nxtelev (+ (* dist1 slope) nxtelev)
   )
   (princ (strcat "\n                        Distance is  " (rtos dist1)))
   (princ (strcat "\n                           Slope is  " (rtos (* dist1 slope))))
   (princ (strcat "\n                       Elevation is  " (rtos nxtelev)))
          (princ (strcat "\n                       Elevation is  " (rtos (/ nxtelev 12.0) 2 2)"'"))
   (princ (strcat "\n                     Running Total Distance is  " (rtos distm)))
 )
)
      )
    (princ (strcat "\n                       Final Total Distance is  " (rtos distm)))
    (princ (strcat "\n                   Final Total Slope Change is  " (rtos (* distm slope))))
    (princ (strcat "\n                            Final Elevation is  " (rtos nxtelev)))
    (princ (strcat "\n                            Final Elevation is  " (rtos (/ nxtelev 12.0) 2 2)"'"))
    (princ)
    )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Slope Calculator based on Start and End Elevations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun slcalce ( / nstelev nendelev distm dist1 nxtelev firstpt PT1 PT2)
      (if (setq nstelev (getdist (strcat "Enter Starting Elevation <" (RTOS stelev) ">: ")))
 (setq stelev nstelev)
      )
      (if (setq nendelev (getdist (strcat "  Enter Ending Elevation <" (RTOS endelev) ">: ")))
 (setq endelev nendelev)
      )
      (setq slope (- 0.0 (- stelev endelev))
   FIRSTPT (getpoint "Pick point ")
   PT2 (getpoint FIRSTPT "\nNext point ")
   distm (distance firstpt pt2)
      )
   (princ (strcat "\n                         Distance is  " (rtos (distance firstpt pt2))))
      (while (/= PT2 nil)
(setq PT1 PT2)
(setq PT2 (getpoint PT1 "\n\nNext point "))
(if (/= PT2 nil)
 (progn
   (setq dist1 (distance pt1 pt2)
 distm (+ distm dist1)
   )
   (princ (strcat "\n                         Distance is  " (rtos dist1)))
   (princ (strcat "\n           Running Total Distance is  " (rtos distm)))
 )
)
      )
    (princ (strcat "\n           Total Elevation Change is  " (rtos slope 2 6)))
    (princ (strcat "\n             Final Total Distance is  " (rtos distm)))
    (princ (strcat "\n                    Percent Slope is  " (rtos (/ slope distm) 2 8) "     Neg.=Down  Pos.=Up"))
      (setq slope (/ slope distm))
    (princ)
    )
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Kick-off routine
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(initget "Slope Elevation")
(setq ans (getkword "\nKnown (S)lope or (E)levations  < S/E >"))
(If (= ans "Slope")(slcalcs)(slcalce))
(princ)
)


I'm sure the guys here can clean it up considerably.  Somewhere I have a modified version that inserts an Elevation block at each point along the way.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« Reply #5 on: March 19, 2005, 11:33:03 AM »
wow... that would be great! if you can find that.

thanks!!!!
Civil3D 2020

CADaver

  • Guest
Engineering Site Grading question
« Reply #6 on: March 19, 2005, 12:34:26 PM »
Quote from: MSTG007
wow... that would be great! if you can find that.

thanks!!!!
If I were you, I'd probably wait on some of the real gurus around here to post some truly elegant code.  (CAB that'd include you dood).  But here is what I have.  
For this to work you need to go HERE , look in directory CADAVER, and download IELEV.DWG into <SOMEDIRECTORY> on your system,
Then, you need to edit the routine to change "E:/CLIENT/MATRIX/TABS/str/" to  <SOMEDIRECTORY>

NOTICE: This thang has NO error trapping.  Should you choose to use it, you are on yer own, Bubba.
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Slope Tag  V1.2, 1989, '92
;; by RBCulp - Falcon Design Services, Inc.
;;
;; NO RIGHTS RESERVED; Any and all content may reproduced by any method on any medium for any reason.
;; Please, feel free to use any part found useful, interesting, enlightening or entertaining.
;; If by some chance, someone wishes to be credited for this, go right ahead.
;;
;; Falcon Design Services (FDS) provides this program "as is" and with all faults.
;; FDS specifically disclaims any implied warranty of merchantability or fitness for a particular use.  
;; FDS does not warrant that the operation of the program will be uninterrupted or error free.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:sltag ( / scft nstelev nslope FIRSTPT PT1 PT2 distm dist1 nxtelev)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;Set defaults on first use
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(if (= stelev nil)  (setq stelev 1200.00))
(if (= slope nil)   (setq slope -0.002))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command ".undo" "begin")
(setvar "attdia" 0)
(setvar "texteval" 1)
(setq scft (getvar "dimscale"))
 (if (= 2 (getvar "lunits")) (setq tunit 2 tprec 3) )
 (if (= 4 (getvar "lunits")) (setq tunit 4 tprec 4) )
   (if (setq nstelev (getdist (strcat "Enter Starting Elevation <" (RTOS stelev) ">: ")))
       (setq stelev nstelev)
   )
   (if (setq nslope (getreal (strcat "Enter Slope Factor (Negative For Down) <" (RTOS slope 2 8) ">: ")))
       (setq slope nslope)
   )
  (setq FIRSTPT (getpoint "Select Starting point ")
PT2 (getpoint FIRSTPT "\nNext point ")
distm (distance firstpt pt2)
nxtelev (+ (* distm slope) stelev)
  )
(princ (strcat "\n                        Distance is  " (rtos (distance firstpt pt2))))
(princ (strcat "\n                           Slope is  " (rtos (* distm slope))))
(princ (strcat "\n                       Elevation is  " (rtos nxtelev tunit tprec)))
;;;; (txstla)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "-insert" "E:/CLIENT/MATRIX/TABS/str/Ielev" "s" scft "r" "45" pt2 (strcat (rtos (/ nxtelev 12.0) 2 2)"'"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (while (/= PT2 nil)
    (setq PT1 PT2)
    (setq PT2 (getpoint PT1 "\n\nNext point "))
    (if (/= PT2 nil)
      (progn
(setq dist1 (distance pt1 pt2)
     distm (+ distm dist1)
     nxtelev (+ (* dist1 slope) nxtelev)
)
(princ (strcat "\n                        Distance is  " (rtos dist1)))
(princ (strcat "\n                           Slope is  " (rtos (* dist1 slope))))
(princ (strcat "\n                       Elevation is  " (rtos nxtelev tunit tprec)))
(princ (strcat "\n          Running Total Distance is  " (rtos distm)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(command "-insert" "E:/CLIENT/MATRIX/TABS/str/Ielev" "s" scft "r" "45" pt2 (strcat (rtos (/ nxtelev 12.0) 2 2)"'"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      )
    )
  )
(princ (strcat "\n\n          Final Total Distance is  " (rtos distm)))
(setvar "attdia" 1)
(command ".undo" "end")
(princ)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« Reply #7 on: March 19, 2005, 03:26:20 PM »
Code: [Select]


Command:  SLTAG .undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: begin
Command: Enter Starting Elevation <78.0000>:
Enter Slope Factor (Negative For Down) <-0.00200000>:
Select Starting point
Next point 100

                        Distance is  100.0000
                           Slope is  -0.2000
                       Elevation is  77.800-insert Enter block name or [?]
<ielev>: C:ielev Specify insertion point or
[Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]: s Specify scale factor for XYZ
axes: 1.000000000000000 Specify insertion point or
[Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]: r Specify rotation angle: 45
Specify insertion point or [Scale/X/Y/Z/Rotate/PScale/PX/PY/PZ/PRotate]:
Enter attribute values
ELEV....: 6.48'



hey. i set it up like you said... but the 6.48' is suppose to be a 64.89'

I started at a 78 elevation and carried it...

other than that the block comes in ok!
Civil3D 2020

CADaver

  • Guest
Engineering Site Grading question
« Reply #8 on: March 19, 2005, 04:08:59 PM »
Oops, sorry.  Mine is set up for working in ft-in drawings (LUPREC=4).  You must be working in ft-dec drawings (LUPREC=2).  So you have to remove the division by 12 part of the attribute fill-in

change this line (both of them)
Code: [Select]
(command "-insert" "E:/CLIENT/MATRIX/TABS/str/Ielev" "s" scft "r" "45" pt2 (strcat (rtos (/ nxtelev 12.0) 2 2)"'"))

to
Code: [Select]
(command "-insert" "E:/CLIENT/MATRIX/TABS/str/Ielev" "s" scft "r" "45" pt2 (strcat (rtos nxtelev 2 2)"'"))

and try it again.

BTW, you can also add a
Code: [Select]
(setvar "cmdecho" 0)at the top after the "UNDO" line to cleanup the echoing.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Engineering Site Grading question
« Reply #9 on: March 20, 2005, 12:22:03 AM »
CADaver,
Nice routine.
I tweaked it a bit, added the Make Block so you don't have to have the ielev.DWG
Need to revise the way the feet mark is added to the elev tag. May have to prompt the use during start up
to see what unit of measure he/she is using. To little time to much code. :)
Anyway give it a spin.

Code: [Select]

;;=========================================================================================
;; Slope Tag  V1.2, 1989, '92
;;   Revised 03/19/2005 - CAB
;; by RBCulp - Falcon Design Services, Inc.
;;
;; NO RIGHTS RESERVED; Any and all content may reproduced by any method on any medium for any reason.
;; Please, feel free to use any part found useful, interesting, enlightening or entertaining.
;; If by some chance, someone wishes to be credited for this, go right ahead.
;;
;; Falcon Design Services (FDS) provides this program "as is" and with all faults.
;; FDS specifically disclaims any implied warranty of merchantability or fitness for a particular use.  
;; FDS does not warrant that the operation of the program will be uninterrupted or error free.
;;=========================================================================================
(defun c:sltag (/ scft nstelev nslope FIRSTPT PT1 PT2 distm dist1 nxtelev
                *error* save_sys_vars restore_sys_vars make_block $elev)
  ;;===============================================
  ;;         L o c a l   F u n c t i o n s        
  ;;===============================================
  ;; error function & Routine Exit
  (defun *error* (msg)
    (if
      (not
        (member
          msg
          '("console break" "Function cancelled" "quit / exit abort" "")
        )
      )
       (princ (strcat "\nError: " msg))
    )   ; endif
    (restore_sys_vars); reset vars
  )


 
  ;; Function to save system variables in global variable
  (defun save_sys_vars (lst)
    (setq *sysvarlist* '())
    (repeat (length lst)
      (setq *sysvarlist* (append *sysvarlist* (list (list (car lst) (getvar (car lst))))))
      (setq lst (cdr lst))
    )
  )

  ;; Function to reset system variables
  (defun restore_sys_vars ()
    (repeat (length *sysvarlist*)
      (setvar (caar *sysvarlist*) (cadar *sysvarlist*))
      (setq *sysvarlist* (cdr *sysvarlist*))
    )
  )

  ;;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  ;;           Make the elevation tag block        
  ;;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  (defun make_block(blockname)
    ;;==============================================
    ;;       Start of Block definition              
    ;;==============================================
    (entmake
      (list '(0 . "BLOCK")            ; required
            '(100 . "AcDbEntity")     ; recommended
            '(100 . "AcDbBlockBegin") ; recommended
            (cons 2 blockname)        ; required
            '(8 . "0")                ; recommended
            '(70 . 2)                 ; required [NOTE 0 if no attributes]
            '(10 0.0 0.0 0.0)         ; required
      )
    )
   
    ;;==============================================
    ;;            Block objects                    
    ;;==============================================
    ;; NOTE: Wipeouts must be created first for other objects to be visable
    (entmake '((0 . "WIPEOUT") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
              (100 . "AcDbWipeout") (90 . 0) (10 0.0078125 -0.0859375 0.0) (11 0.625 0.0 0.0)
              (12 0.0 0.625 0.0) (13 1.0 1.0 0.0) (70 . 7) (280 . 1)
              (281 . 50) (282 . 50) (283 . 0) (71 . 2) (91 . 9) (14 -0.5 0.4625 0.0)
              (14 -0.225 0.4625 0.0) (14 -0.225 0.5 0.0) (14 0.5 0.5 0.0) (14 0.5 0.225 0.0)
              (14 -0.225 0.225 0.0) (14 -0.225 0.2625 0.0) (14 -0.5 0.2625 0.0) (14 -0.5 0.4625 0.0)))
    (entmake '((0 . "ATTDEF") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 . "AcDbText")
              (10 0.279583 -0.05 0.0) (40 . 0.1) (1 . "") (50 . 0.0) (41 . 0.7) (51 . 0.0)
              (7 . "Standard") (71 . 0) (72 . 1) (11 0.40625 0.0 0.0) (210 0.0 0.0 1.0)
              (100 . "AcDbAttributeDefinition") (3 . "ELEV....") (2 . "ELEV") (70 . 0)
              (73 . 0) (74 . 2)))
    (entmake '((0 . "LWPOLYLINE") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
              (100 . "AcDbPolyline") (90 . 4) (70 . 1) (43 . 0.0) (38 . 0.0) (39 . 0.0)
              (10 0.183594 -0.0789062) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 0.628906 -0.0789062)
              (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 0.628906 0.0789062) (40 . 0.0) (41 . 0.0)
              (42 . 0.0) (10 0.183594 0.0789062) (40 . 0.0) (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0)))
    (entmake '((0 . "TEXT") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0")
              (100 . "AcDbText") (10 0.00806548 -0.05 0.0) (40 . 0.1) (1 . "I.E.") (50 . 0.0)
              (41 . 0.8) (51 . 0.0) (7 . "Standard") (71 . 0) (72 . 2) (11 0.171875 0.0 0.0)
              (210 0.0 0.0 1.0) (100 . "AcDbText") (73 . 2)))
 
    ;;==============================================
    ;;     This is the end of block marker          
    ;;==============================================
    (entmake (list '(0 . "ENDBLK")         ; required
                   '(100 . "AcDbBlockEnd") ; recommended
                   '(8 . "0")              ; recommended
                   ))
    ;;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
  ) ;                 end defun make_block            
    ;;-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_

 
  ;;************************************************************************
  ;;************************************************************************
  ;;                    S T A R T   O F   R O U T I N E                    
  ;;************************************************************************
  ;;************************************************************************

  ;;------------------------------------------------------------------------
  ;;    Set defaults on first use
  ;;------------------------------------------------------------------------
  (or *stelev* (setq *stelev* 1200.00))
  (or *slope*  (setq *slope*  -0.002))
  (if (not (setq *units*
              (car(member *units* '("Inch" "Foot" "Meter" "Centimeter")))))
    (progn
      (initget "Inch Foot Meter Centimeter")
      (setq *units*
             (getkword
               "\nOne Unit in this drawing = [Inch/Foot/Meter/Centimeter] <Inch>:"))
      (or *units* (setq *units* "Inch"))
    )
  )
  ;;------------------------------------------------------------------------
 
  (command ".undo" "begin")
 
  (save_sys_vars '("CMDECHO" "attdia" "attreq" "texteval"))
  (setvar "cmdecho"  0)
  (setvar "attdia"   0)
  (setvar "attreq"   1)
  (setvar "texteval" 1)
 
  (setq scft  (getvar "dimscale")
        tunit (getvar "lunits")
        distm 0)
    ;;  ????????????????????
  (cond
    ((= 2 tunit)
      (setq tprec 3)
    )
    ((= 4 tunit)
      (setq tprec 4)
    )
    (T
      (setq tprec 3)
    )
  ) ; ?????????????????????
 
  ;;------------------------------------------------------------------------
  (if (and (not (tblsearch "Block" "Ielev"))
           (not (make_block "Ielev")))
    (progn
      (alert "Make Block Failed, can not continue.")
      (exit)
    )
  )
 
 (if (and
        (or (not (setq nstelev
             (getdist (strcat "Enter Starting Elevation <" (RTOS *stelev*) ">: "))))
           (setq *stelev* nstelev))
        (or (not (setq nslope (getreal (strcat "Enter Slope Factor (Negative For Down) <"
                                    (RTOS *slope* 2 8)  ">: " ))))
            (setq *slope* nslope))
        (setq FIRSTPT (getpoint "Select Starting point "))
        (setq pt1     firstpt
              nxtelev *stelev*)
      ) ; and

  ;;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
    (while (setq PT2 (getpoint PT1 "\n\nNext point "))
     
      (setq dist1   (distance pt1 pt2)
            distm   (+ distm dist1)
            nxtelev (+ (* dist1 *slope*) nxtelev)
            PT1 PT2
      )
      (princ (strcat "\n                        Distance is  " (rtos dist1)))
      (princ (strcat "\n                           Slope is  "
                     (rtos (* dist1 *slope*))))
      (princ (strcat "\n                       Elevation is  "
                     (rtos nxtelev tunit tprec)))
      (princ (strcat "\n          Running Total Distance is  " (rtos distm)))
      ;;------------------------------------------------------------------------
      (if (= *units* "Inch") ; convert to feet
        (setq $elev (rtos (/ nxtelev 12.0) 2 2))
        (setq $elev (rtos nxtelev 2 2))
      )
      (if (or (eq *units* "Inch") (eq *units* "Foot"))
        (setq $elev (strcat $elev "'"))
      )
       
      (command "-insert" "Ielev" "s" scft "r" "45" pt2 $elev)
      ;;------------------------------------------------------------------------
    ) ; end while
    ;;+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  ); endif

  (princ (strcat "\n\n          Final Total Distance is  " (rtos distm)))

  (command ".undo" "end")
                 
  (*error* "") ; restore variables
 
  (princ)
)
(prompt "\n***   Slope Tag Loaded, Enter sltag to run.  ***")
(princ)
;;=========================================================================================
;;  eof
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Engineering Site Grading question
« Reply #10 on: March 20, 2005, 09:04:58 AM »
Had it working last night but.
Got an error, the make block doesn't work yet.
I'll see if I can fix it this afternoon.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« Reply #11 on: March 20, 2005, 01:25:39 PM »
Code: [Select]

stupid question.

how hard would it be to add a leader with text above the leader telling the slope with the direction?

And then possibly have the block look like a grading spot elevation?

 _______
|XXX.XX|
----------
               \
                \
                 X    < ---  location of spot

Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Engineering Site Grading question
« Reply #12 on: March 20, 2005, 07:36:23 PM »
Updated the code above. Got the block create code working.
Added the prompt for units. :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Engineering Site Grading question
« Reply #13 on: March 20, 2005, 08:09:44 PM »
hey cab
I am using CIVIL 3D 2k5

I am getting a

"Make Block Failed, can not continue"


***   Slope Tag Loaded, Enter sltag to run.  ***
Command: sltag
.undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: begin
Command:
Command:
SLTAG .undo Enter the number of operations to undo or
[Auto/Control/BEgin/End/Mark/Back] <1>: begin
Command:

any ideas?

thanks!
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Engineering Site Grading question
« Reply #14 on: March 20, 2005, 08:22:39 PM »
Did you copy the code again?
I updated it 40 minutes ago.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.