Code Red > XDRX-API

[XDrX-PlugIn(152)] Find overlapping dimension text and mark it with a cloud

(1/1)

xdcad:


--- Code: ---(defun c:xdtb_dimchkoverlaps ( / box ents len len1 overlaps pl ss x)
  (defun _make-cloud ()
    (setq pl (xdrx-polyline-make box t))
    (xdrx-curve->cloud pl (/ len1 1.1) 0.35 (/ len1 4.0) 0.0)
    (xdrx-setpropertyvalue (entlast) "color" 2)
    (xdrx-block-make
      (strcat "xd_dim_overlap_mark"
      (strcase (xdrx-string-rand 6) t)
      )
      (entlast)
      (trans (xd::geom:get9pt (entlast) 5) 1 0)
      t
    )
  )
  (xdrx-begin)
  (if (and (setq ss (xdrx-ssget
      (xdrx-string-multilanguage
"\n选择查询的标注对象<退出>:"
"\nSelect the Dimension object of the query<Exit>:"
      )
      '((0 . "dim*"))
    )
   )
   (setq overlaps (xd::dim:textoverlaps ss))
      )
    (progn
      (mapcar '(lambda (x)
(setq ents (car x)
       box  (cadr x)
       len  (/ (distance (nth 0 box) (nth 1 box)) 4.0)
       len1 (distance (nth 0 box) (nth 3 box))
       box  (xdrx-points-offset (/ len1 3.5) box)
)
(_make-cloud)
       )
      overlaps
      )
    )
  )
  (xdrx-end)
  (princ)
)

--- End code ---

Navigation

[0] Message Index

Go to full version