Author Topic: Redefine only blocks with a prefix name and synchronise attributes  (Read 203 times)

0 Members and 1 Guest are viewing this topic.

francinez13

  • Mosquito
  • Posts: 3
I have a lisp written by Lee Mac which works very well.

My only problem is that when I have hundred of blocks on my drawing the lisp takes a very long time to run.

Is it possible to redefine only the blocks starting with the block name TM.....?

example of block name : TM-1005, TM-0349, TM-1006........

Thank you for your help

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Redefine only blocks with a prefix name and synchronise attributes
« Reply #1 on: April 15, 2024, 05:57:29 PM »
Replace:
Code - Auto/Visual Lisp: [Select]
  1. (not (wcmatch (setq bln (vla-get-name blk)) "`**,*|*"))
With:
Code - Auto/Visual Lisp: [Select]
  1. (wcmatch (strcase (setq bln (vla-get-name blk))) "TM-*")