Author Topic: Select the similiar  (Read 4346 times)

0 Members and 1 Guest are viewing this topic.

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Select the similiar
« Reply #15 on: February 16, 2017, 03:13:49 PM »
Here's something to layer the circle & text objects based on your example drawing:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ ss)
  2.   (if (setq ss (ssget "_x"
  3.                       '((-4 . "<OR")
  4.                         (-4 . "<AND")
  5.                         (0 . "mtext")
  6.                         (1 . "#,##")
  7.                         (-4 . "AND>")
  8.                         (-4 . "<AND")
  9.                         (0 . "circle")
  10.                         (-4 . "<=")
  11.                         (40 . 1.5)
  12.                         (-4 . "AND>")
  13.                         (-4 . "OR>")
  14.                        )
  15.                )
  16.       )
  17.     (foreach x (mapcar 'cadr (ssnamex ss))
  18.       (entmod (subst '(8 . "-NRO-LOTE") (assoc 8 (entget x)) (entget x)))
  19.     )
  20.   )
  21.   (princ)
  22. )

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Fabricio28

  • Swamp Rat
  • Posts: 670
Re: Select the similiar
« Reply #16 on: February 17, 2017, 05:28:54 AM »
Here's something to layer the circle & text objects based on your example drawing:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:foo (/ ss)
  2.   (if (setq ss (ssget "_x"
  3.                       '((-4 . "<OR")
  4.                         (-4 . "<AND")
  5.                         (0 . "mtext")
  6.                         (1 . "#,##")
  7.                         (-4 . "AND>")
  8.                         (-4 . "<AND")
  9.                         (0 . "circle")
  10.                         (-4 . "<=")
  11.                         (40 . 1.5)
  12.                         (-4 . "AND>")
  13.                         (-4 . "OR>")
  14.                        )
  15.                )
  16.       )
  17.     (foreach x (mapcar 'cadr (ssnamex ss))
  18.       (entmod (subst '(8 . "-NRO-LOTE") (assoc 8 (entget x)) (entget x)))
  19.     )
  20.   )
  21.   (princ)
  22. )

Ron,

Fantastic!!!

Worked like a charm.

Thank you very much for the help. :)

Fabricio

ronjonp

  • Needs a day job
  • Posts: 7527
Re: Select the similiar
« Reply #17 on: February 17, 2017, 11:33:20 AM »
 :)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC