Message 1 of 5

Not applicable
07-21-2015
08:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi guys
Can make this routine draw trapezoid on the face of 3d solid ?
Here is draw isosceles trapezoid
code was at: http://www.cadtutor.net/forum/showthread.php?88383-Draw-an-isosceles-trapezoid
(defun c:Test (/ dtr ac ab p sl a b c d e p) ;; Author : Tharwat Al Shoufi ;; ;; Draw Trapezoid with angle 55 on the two sides ;; ;; -------------------------------------------------- ;; (defun dtr (a) (* pi (/ a 180.0))) (if (not *traplen*) (setq *traplen* 10.0) ) (if (not *traphgt*) (setq *traphgt* 4.0) ) (if (and (setq *traplen* (cond ((getdist (strcat "\n Specify Length of Trapezoid < " (rtos *traplen* 2 2) " > :"))) (*traplen*) ) ) (setq *traphgt* (cond ((getdist (strcat "\n Specify Height of Trapezoid < " (rtos *traphgt* 2 2) " > :"))) (*traphgt*) ) ) (setq ac (/ *traphgt* (sin (dtr 55.))) ab (* ac (cos (dtr 55.))) ) (if (>= (setq sl (- *traplen* (+ ab ab))) 0.) (setq p (getpoint "\n Specify top center point of Trapezoid :")) (progn (alert "Length of Trapezoid is too small !!") nil) ) ) (progn (setq a (polar p pi (/ sl 2.)) b (polar a (dtr 235.) ac) c (polar b 0. *traplen*) d (polar c (dtr 125.) ac) e (entmakex (append (list '(0 . "LWPOLYLINE") '(100 . "AcDbEntity") '(100 . "AcDbPolyline") '(90 . 4) '(70 . 1)) (mapcar '(lambda (pt) (cons 10 (list (car pt) (cadr pt)))) (list a b c d)) ) ) ) ) ) (if e (command "_.rotate" e "" "_non" p "\\") ) (princ) )
Reference image from other member. Thanks.
Solved! Go to Solution.