@colleen.dunn wrote:
Thank you so much. This looks pretty close. The property name is different for each drawing, and I don't know the name without opening each file. So testing for the number, which I can supply and is different for each drawing, the layer (DEFAULT) and the text height (13.0) is the best choice.
Yes I'm counitng on you to say that, we can do away with the numbers then. We will go with the layer and height as identifier.
@colleen.dunn wrote:
I have a number of routines to run on each drawing so I'm quite captivated by your suggestion that the routines can be run without graphically opening the files.
--------
Sorry, I forgot to say that it is only a one-time thing. If it fails on any drawings it can be done manually. The file/property number will come from a list so the routine probably needs a variable into which to feed the number.
Its nothing new really, we do it all the time, i have not cosider the fact you will be running more than just one routine, Since you will be running a script, I guess we could piggy back along with the original script and use the approach that @Kent1Cooper and @john.uhden posted here.
(tblsearch "LAYER" "Chocolate")
(ssget "_X" '((8 . "Chocolate")))
If ssget yields nothing | tblsearch it true , you may need to search inside the blocks for the object.
Or perhaps, run purge layer.
@colleen.dunn wrote:
Layer and height reasonably constant (I hope).
I hope so too.
In the posted code, this part is where you provide the correct layer name in place of "Chocolate" and the 2 statements "STATEMET 1" and "STATEMENT 2"
....
;; the layer name to search for
"Chocolate"
;; Statement IF Layer is assigned to an object
(list
(strcat
"\\P{\\H0.38462x;" "STATEMENT 1"
"}")
;; Statement IF Layer is NOT assigned to an object
(strcat
"\\P{\\H0.38462x;" "STATEMENT 2"
"}")
)
;; Target MTEXT
(setq data '("DEFAULT" 13.00))
....
HTH
Screencast