Message 1 of 7
Function to create Trapezoid with indent
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
so im currently using the function below to create a trapezoid
(defun _trap (p1 p2 p3 p4 / lt point2d x1 y1 x2 y2 pts q)
(defun lt (pt) (trans pt 1 0))
(defun point2d (pt) (list (car pt) (cadr pt)))
;(command "_.ucs" "w")
(princ "doing setq")
(setq
x1 (apply 'min (mapcar 'car (list p1 p2)))
y1 (apply 'min (mapcar 'cadr (list p1 p2)))
x2 (apply 'max (mapcar 'car (list p1 p2)))
y2 (apply 'max (mapcar 'cadr (list p1 p2)))
pts (mapcar 'point2d(mapcar 'lt (list (list x1 y1) (list x2 y1) (list x2 (+ y1 p4) ) (list (- x2 p3) y2) (list (+ x1 p3) y2) (list x1 (+ y1 p4) ) )))
)
(cond
((and pts)
(setq q (entmakex
(apply 'append
(cons
(list
'(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(100 . "AcDbPolyline")
'(410 . "Model")
'(8 . "0")
'(38 . 0)
'(62 . 256)
'(67 . 0)
(cons 90 (length pts))
'(70 . 1)
)
(mapcar 'list (mapcar '(lambda (a) (cons 10 a)) pts))
)
)
))
)
)
q
)
, but what i need now is a function that will make a trapezoid with indents im just not sure how to do the math on it, can any1 help? i have a picture as an attachment where i will give 7 points to make it happen instead of 4