Author Topic: [XDrX-Function(22)] point set maximum perimeter rectangle  (Read 285 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 514
[XDrX-Function(22)] point set maximum perimeter rectangle
« on: December 10, 2023, 12:51:39 PM »
Max Perimeter function:

Code - Auto/Visual Lisp: [Select]
  1. (xdrx_points_MaxPerimeterBox <pts>)
  2. parameter:
  3. pts: point list
  4. return value:
  5. LIST: (point point  point point)
  6.  


Code - Auto/Visual Lisp: [Select]
  1. (defun c:tt ()
  2.   (if (setq ss (xdrx-ssget "\nSelect Points<Exit>" '((0 . "point"))))
  3.     (progn
  4.       (setq pts (xdrx-getpropertyvalue ss "position")
  5.             pts (apply 'append pts)
  6.             box (xdrx_points_MaxPerimeterBox pts)
  7.       )
  8.       (xdrx-polyline-make box t)
  9.       (xdrx-setpropertyvalue (entlast) "color" 4)
  10.     )
  11.   )
  12.   (princ)
  13. )
« Last Edit: December 10, 2023, 02:20:06 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net