;;; anglemaker3d.lsp ;;; a program that draws the end view of an angle and exturdes it ;;; Copyright 2007 by Brian Gibbs (alert "\n Anglemaker3d.lsp - Copyright 2007 by Brian Gibbs \n Type am3d to Start") ;;; start the program (defun c:am3d () ;;; drawing setup (setq osm (getvar "osmode")) (setvar "osmode" 0) ;;; user input (setq sp (getpoint "\npick the starting point ")) (setq leg1 (getreal "\nwhat is the length of leg 1? ")) (setq thk1 (getreal "\nwhat is the thickness of leg 1? ")) (setq leg2 (getreal "\nwhat is the length of leg 2? ")) (setq thk2 (getreal "\nwhat is the thickness of leg 2? ")) (setq rad (getreal "\nThe angle interior Radius is? ")) (setq exl (getreal "\nWhat is the extrude length? ")) ;;; do the math (setq x1 (car sp) x2 (+ x1 thk2) x3 (+ x2 rad) x5 (+ x1 leg1) x4 (- x5 thk1) y1 (cadr sp) y2 (+ y1 thk1) y3 (+ y2 rad) y5 (+ y1 leg2) y4 (- y5 thk2) ) ;;; point assignnment (setq p1 (list x1 y1) p2 (list x5 y1) p3 (list x4 y2) p4 (list x3 y2) p5 (list x2 y3) p6 (list x2 y4) p7 (list x1 y5) p8 (list x5 y5) ) ;;; lets draw (command "zoom" "w" p1 p8 ) (command "line" p1 p2 "") (setq ss1 (ssget "L")) (command "line" p4 p3 "") (setq ss2 (ssget "L")) (command "line" p5 p6 "") (setq ss3 (ssget "L")) (command "line" p1 p7 "") (setq ss4 (ssget "L")) (command "arc" p2 "e" p3 "r" thk1) (setq ss5 (ssget "L")) (command "arc" p6 "e" p7 "r" thk2) (setq ss6 (ssget "L")) (command "arc" p5 "e" p4 "r" rad) (setq ss7 (ssget "L")) ;;; Extrude 3D (command "pedit" ss1 "" "j" ss2 ss3 ss4 ss5 ss6 ss7 "" "") (print "select the angle") (setq ss8 (ssget )) (command "extrude" ss8 "" exl "" ) ;;; end the program (setvar "osmode" osm) )