; extruded_channel.lsp - a program that draws a side view of an extruded channel ; copyright 2007 by Charles Robbins (alert "extruded_channel.lsp - copyright 2007 by Charles Robbins. Type exchannel to start") ; start the program (defun c:exchannel () ; drawing setup (setq osm (getvar "osmode")) ; gets osnap settings and assigns them to osm (setvar "osmode" 0) ; turns osnap settings off ; user input (setq sp (getpoint "\nPick the starting point ")) (setq hgt (getreal "\nWhat is the height of the channel? ")) (setq thk1 (getreal "\nWhat is the thickness of the web? ")) (setq thk2 (getreal "\nWhat is the thickness of the leg? ")) (setq width (getreal "\nWhat is the width of the channel? ")) ; do the math (setq x1 (car sp) x2 (+ x1 thk1) x3 (+ x1 hgt) y1 (cadr sp) y2 (+ y1 thk2) y4 (+ y1 width) y3 (- y4 thk2) ) ; point assignments (setq p1 (list x1 y1) p2 (list x3 y1) p3 (list x3 y2) p4 (list x2 y2) p5 (list x2 y3) p6 (list x3 y3) p7 (list x3 y4) p8 (list x1 y4) ) ; lets draw (command "line" p1 p2 p3 p4 p5 p6 p7 p8 "c") ; end the program (setvar "osmode" osm) ; turns osnap settings back on )