Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun C:ELEVF ()
- (setq ;sets first round of variables
- ;stores previous system variables
- PSNAP (getvar "OSMODE") ;stores previous snap variable for recall
- PLAYER (getvar "CLAYER") ;stores previous layer
- ;stores previous function variables
- PW W ;sets [P]revious[W]idth as [W]
- POH OH ;sets [P]revious[OH] as [OH]
- PFH FH ;[P]revious[FH] as [FHH]
- PSH SH ;[P]revious[SH] as [SH]
- PP P ;[P]revious[P] as [P]
- PST ST ;[P]revious[ST] as [ST]
- PBP BP ;[P]revious[BP] as [BP]
- PX X ;[P]revious[X] as [X]
- PY Y ;[P]revious[Y] as [Y]
- ;requests and stores variables needed for function
- W (getdist "\nLength of the wall:") ;sets W as wall length
- OH (getdist "\nEnter overhang length:") ;sets OH as the overhang length
- FH (getdist "\nEnter fascia height:") ;sets FH as the fascia height
- SH (getdist "\nEnter height of soffit from grade:") ;sets SH as the soffit height from grade
- P (getreal "\nEnter roof pitch: \n12/") ;sets the roof pitch in terms of 12:__ pitch
- ST (getdist "\nSide Trim Width:") ;Side trim width request
- BP (getpoint "Select the point you want the lower left line to start:") ;sets the point from which all variable points are relative
- X (car BP) ;sets X as the x coordinate of BP
- Y (cadr BP) ;sets Y as the y coordinate of BP
- DY (sin ;sets the delta Y constant for offsetting rake trim (will be used later with rake offset values EX: (/ 2.5 DY)
- (-
- (/ PI 2)
- (atan P 12)
- )
- )
- )
- (setq
- PT1 (list ;starts gable elevation
- X
- Y
- )
- PT2 (list ;line up to soffit
- X
- (+ Y SH)
- )
- PT3 (list ;line left for overhang
- (- X OH)
- (+ Y SH)
- )
- PT4 (list ;line up for fascia
- (- X OH)
- (+ Y (+ SH FH))
- )
- PT5 (list ;line from fascia top to ridge
- (+ X (/ W 2))
- (+ Y (+ SH (+ FH (* (/ (+ (/ W 2) OH) 12) P))))
- )
- PT6 (list ;line from ridge to right fascia top
- (+ X (+ W OH))
- (+ Y (+ SH FH))
- )
- PT7 (list ;line from right fascia top to soffit + overhang
- (+ X (+ W OH))
- (+ Y SH)
- )
- PT8 (list ;line from overhang to soffit
- (+ X W)
- (+ Y SH)
- )
- PT9 (list ;line from right soffit back to grade
- (+ X W)
- Y
- )
- PT1T (list ;sets first point for left side trim
- (+ X ST)
- (+ Y 8)
- )
- PT2T (list ;sets second point for left side trim *** NEEDS TO BE CHANGED TO ACCOUNT FOR THE RAKE FASCIA LOCATION
- (+ X ST)
- (+ (- (cadr PT4) (/ 11 DY)) (/ (* (+ OH ST) P) 12))
- )
- PT9T (list ;sets first point for right side trim
- (+ X (- W ST))
- (+ Y 8)
- )
- PT8T (list ;sets second point for right side trim *** NEEDS TO BE CHANGED TO ACCOUNT FOR THE RAKE FASCIA LOCATION
- (+ X (- W ST))
- (cadr PT2T)
- )
- )
- (setvar "OSMODE" 0) ;turns off ALL OSNAPS
- (setvar "CLAYER" "A-OBJECT-OUTLINE") ;sets layer to A-OBJECT-OUTLINE
- (command "LINE" PT1 PT2 PT3 PT4 PT5 PT6 PT7 PT8 PT9 "") ;draw elevation outline
- (setvar "CLAYER" "A-OBJECT-MINOR") ;sets layer to A-OBJECT-MINOR
- (command "LINE" PT1T PT2T "") ;Draws left side trim
- (command "LINE" PT9T PT8T "") ;Draws right side trim
- (command "LINE" ;draws foundation line
- (list ;sets left foundation line point
- X
- (+ Y 8)
- )
- (list ;sets right foundation line point
- (+ X W)
- (+ Y 8)
- )
- "" ;ends line command
- )
- (command "LINE" ;draws first rake trim
- (list ;sets the first rake first point
- (car PT4) (- (cadr PT4) (/ 2.5 DY)) ;sets the first point in the first rake line
- )
- (list ;sets the first rake second point
- (+ X (/ W 2)) (- (cadr PT5) (/ 2.5 DY)) ;sets the second point in the first rake line
- )
- (list ;sets the first rake third point
- (car PT6) (- (cadr PT6) (/ 2.5 DY)) ;sets the third point in the first rake line
- )
- "" ;ends line command
- )
- (setvar "CLAYER" "A-OBJECT-MAJOR") ;changes layer to A-OBJECT-MAJOR
- (command "LINE" ;draws second rake trim
- (list ;sets the second rake first point
- (car PT4) (- (cadr PT4) (/ 5.5 DY)) ;sets the first point in the second rake line
- )
- (list ;sets the second rake second point
- (+ X (/ W 2)) (- (cadr PT5) (/ 5.5 DY)) ;sets the second point in the second rake line
- )
- (list ;sets the second rake third point
- (car PT6) (- (cadr PT6) (/ 5.5 DY)) ;sets the third point in the second rake line
- )
- "" ;ends line command
- )
- (setvar "CLAYER" "A-OBJECT-MINOR") ;changes layer to A-OBJECT-MINOR
- (command "LINE" ;draws third rake trim
- (list ;sets the third rake first point
- (+ OH (+ ST (car PT4))) (cadr PT2T) ;sets the first point in the third rake line
- )
- (list ;sets the third rake second point
- (+ X (/ W 2)) (- (cadr PT5) (/ 11 DY)) ;sets the second point in the third rake line
- )
- (list ;sets the third rake third point
- (- (car PT6)(+ ST OH)) (cadr PT8T) ;sets the third point in the third rake line
- )
- "" ;ends line command
- )
- (setvar "OSMODE" PSNAP) ;return osmode var to what it was
- (setvar "CLAYER" PLAYER) ;return CLAYER var to what it was
- (princ) ;clears the command line
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement