Author Topic: Roof Calculator for drawing different roof pitches in plan  (Read 2046 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Roof Calculator for drawing different roof pitches in plan
« on: September 23, 2015, 01:13:11 PM »
I'm working on a dialog based calculator  for drawing different roof pitches in plan.


I'm looking for slides or diagrams showing the geometry and calculations for solving the hips and valleys in roof plan view for intersecting different roof pitches. For example a 12/12 to 12/12 roof pitch would result in a 45 degree angle.

Thanks

Gary
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

GDF

  • Water Moccasin
  • Posts: 2081
Re: Roof Calculator for drawing different roof pitches in plan
« Reply #1 on: September 29, 2015, 09:08:22 PM »
Got it fixed

Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  (defun OVERHANGCALC1  ()
    (mode_tile "overhang" 0)   
    (setvar "insunits" 1)
    (setvar "lunits" 4)
    (if (= pitchval "Select")
      (setq pitchval nil))
    (cond
      ((or (= pitchvalA nil) (= plateghtval nil) (= plateghtval ""))
       (ARCH:MsgBox2
         " Arch Program : Info"
         48
         "
            Roof Calculator Error:
-------------------------------------------------------------------------
     Please fill in the Roof Pitch and Plate height values...and try again.
    "    4))
      ((and (/= pitchvalA "")
            (/= plateghtval ""))
       (cond ((= horzvert "Horizontal")
              (setq overhangval (* (/ pitchvalA 12) (distof plateghtval))))
             ((= horzvert "Vertical")
              (setq overhangval (* (/ 12 pitchvalA) (distof plateghtval)))))
       (set_tile "overhang" (rtos overhangval 4 2))))
    (princ))
;;;
  (defun OVERHANGCALC2  ()
    (mode_tile "overhang" 0)   
    (setvar "insunits" 1)
    (setvar "lunits" 4)
    (if (= pitchval "Select")
      (setq pitchval nil))
    (cond
      ((or (= pitchvalA nil) (= plateghtval nil) (= plateghtval ""))
       (ARCH:MsgBox2
         " Arch Program : Info"
         48
         "
            Roof Calculator Error:
-------------------------------------------------------------------------
     Please fill in the Roof Pitch and Plate height values...and try again.
    "    4))
      ((and (/= pitchvalA "")
            (/= plateghtval ""))
       (cond ((= horzvert "Horizontal")
              (setq overhangval (* (/ pitchvalA 12) (distof plateghtval))))
             ((= horzvert "Vertical")
              (setq overhangval (* (/ 12 pitchvalA) (distof plateghtval)))))
       (set_tile "overhang" (rtos overhangval 4 2))))
    (princ))
;;;DISTANCE = (KNOW WIDTH / 2) (SLOPE A)  /  (SLOPE B)
  (defun OVERHANGCALC3  ()
    (setq distanceA "20'")
    (mode_tile "plateght" 1)
    (set_tile "plateght" "")
    (mode_tile "distanceB" 0)
    (setvar "insunits" 1)
    (setvar "lunits" 4)
   (if (= pitchval "Select")
      (setq pitchval nil))
    (cond
      ((or (= pitchvalA nil) (= pitchvalB nil) (= plateghtval ""))
       (ARCH:MsgBox2
         " Arch Program : Info"
         48
         "
            Roof Calculator Error:
-------------------------------------------------------------------------
     Please fill in the Roof Pitch and Plate height values...and try again.
    "    4))
      ((and (/= pitchvalA "")
            (/= plateghtval ""))
       (cond ((= horzvert "Plan")
              (setq distanceB (* (/ (/ pitchvalA 12) (/ pitchvalB 12)) (/ (distof distanceA) 2))))             
             )
       (set_tile "distanceB" (rtos distanceB 4 2))))
   
    (princ))
;;;
  (defun CALCULATE  ()
    (cond ((= horzvert "Horizontal") (OVERHANGCALC1))
          ((= horzvert "Vertical") (OVERHANGCALC2))
          ((= horzvert "Plan") (OVERHANGCALC3))))
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

HasanCAD

  • Swamp Rat
  • Posts: 1422
Re: Roof Calculator for drawing different roof pitches in plan
« Reply #2 on: September 30, 2015, 02:02:14 AM »
More than excellent