Per Tom Beauford's suggestions, I placed some code I have written inside the nice quoted area. This avoids smiley faces apparently. Nice!
I'm trying to select all mtext and text objects in a revision area to put them on a layer "Text2".
This works great while in a drawing whose dimscale is set to 1. We work solely in Model Space and almost exclusively in a 34x22 title block with dimscale set to 1. But we do have instances of scaled title blocks for scales ranging from 1/4"=1' on up to 3"=1'. Initially all I did was copy the routine that covered our typical title block and multiply all the coordinates by 8 (eight) for a 1 1/2"=1'-0" title block. Got that done and realized I can do better by getting the dimscale of the drawing first then doing the magic. Unfortunately we do not use object based layering so I couldn't just say get all of the objects on this layer. I have to use a crossing window in the revision arae to get all of the mtext and text objects and change them to "Text2" layer.
Code:
(setq txt2 (ssget "c"
'(33.375 21.4375)
'(31.875 5.3125)
'((0 . "MTEXT,TEXT"))
)
)
(command "change" txt2 "" "Properties" "layer" "Text2" "")
I decided I could do better, so started in on this code...
Find the dimscale of the drawing (I'm not doing that below for sure)
Use the dimscale to multiply the coordinates listed (setq txt2 to select the objects where they should be (267,171.5)(255,42.5) in the scaled title block. In this case 1 1/2" = 1'
Change selected text objects at the new coordinates to layer "Text2"
Code:
(defun c:Foo4 (/ Rev1 en1 ed)
(setvar "cmdecho" 1)
(setq Rev1 (mapcar '(lambda (x)(* x 8))'(31.875 5.3125 33.375 21.4375)
)
(setq en1 (entlast))
(setq ed (entget en1))
(setq ed (subst (cons 8 "Text2") (assoc 8 ed) ed))
(entmod ed)
(setvar "cmdecho" 0)
(princ)
)
I've tested...
(setq pt1 (mapcar '(lambda...as above
(setq en1 (entlast
and it works, to a point. It doesn't seem to select everything in the Revision area. It only selects one revision right in the middle of the revision area.
Ohttt, answered my own question there. (entlast)) is the last thing the crossing window selects. How to (enteverything ? nentselp?
My dimscale answer might be that I create a list of ...
(setq Rev1 (mapcar '(lambda (x)(* x "Y"))'(31.875 5.3125 33.375 21.4375)
where "Y" is the dimscale of each title block we use?
orrr....(setq dim1 (ssget "dimscale")
I'd be surprised if I'm even close with any of this.
J. Logan
ACAD 2016