pBe 发表于 2022-7-6 10:02:05

pBe 发表于 2022-7-6 10:05:41

 
Here's a quick one

(defun c:FunForMe(/ Pts plst x1 x2 x3 x4 Pt2Pt Perim area str)   (cond         ((and                  (setq pts (ssget ":L" '((0 . "POINT"))))                  (progn                  (repeat (setq i (sslength pts))                        (setq plst (cons                                       (cdr (assoc 10                                                   (entget                                                         (ssname pts (setq i (1- i))))))                                       plst)                              )                        )                  (setq plst (append plst                                     (list (last (reverse plst)))))                  (repeat (sslength pts)                        (setq x1 (car (car plst))                              x2 (cadr (car plst))                              y1 (car (cadr plst))                              y2 (cadr (cadr plst))                              )                        (setq Pt2Pt                                 (cons (- (* x1 y2) (* x2 y1))                                       Pt2Pt))                        (setq PeriM (cons (distance (car plst)(cadr plst)) PeriM))                        (setq plst (cdr plst))                        )                  (setq Area (abs (/ (apply '+ Pt2pt) 2)))                  )                  (setq str                           (if (or (= (getvar "lunits") 3)                                     (= (getvar "lunits") 4))                                 (strcat                                       (rtos (/ area 144) 2)                                       " sq. ft.")                                 (strcat (rtos Area 2) " m²")                                 )                        )                  (print Str)                  (princ (strcat "\nPerimeter: \"" (rtos (apply '+ Perim) 2 2) "\""))                  )            )         )(princ)   )
 
The thing i need to figure out now is sorting the PontList when using window selection.
页: 1 [2]
查看完整版本: 区域命令帮助?