That's the direction I was inclined to go. Some thoughts came to mind....
It will actually function if the three picked points are in a straight line -- kind of pointless, but there's no reason it can't draw them that way. Whatever the usage, probably the realities of what they're doing will "prevent" their picking three in line with each other, anyway.
A couple of things you can dispense with: the double-quotes around the System Variable names in the 'vars' list, thus:
(setq vars '(cmdecho osmode))
and the 1 in the last (cond)ition in the error handler, which can be just:
((princ (strcat "\nERROR: " error)))
[You need something that does not return nil -- and as I've seen it, most people use T -- as a test if there's more than one thing to do as a none-of-the-above operation, but if there's only one, that itself can be the "condition."]
For the drawing of the parallelograms, this much:
(repeat n
(setq p3 (polar p2 ang w)
p4 (polar p1 ang w)
)
(vl-cmdf "_.pline" p2 p3 p4 p1 "_C")
(setq p2 p3 p1 p4)
)
can be replaced by this, forgetting about the 'p3' variable and eliminating the need for 'p4' entirely:
(repeat n
(vl-cmdf "_.pline" p1 p2 (setq p2 (polar p2 ang w)) (setq p1 (polar p1 ang w)) "_close")
)
Kent Cooper, AIA