Freeze Text Styles but not entire layer??

Freeze Text Styles but not entire layer??

johnw
Collaborator Collaborator
1,097 Views
12 Replies
Message 1 of 13

Freeze Text Styles but not entire layer??

johnw
Collaborator
Collaborator

Is there a way to freeze any all Archstyl text style in a drawing except Style Tahoma and Simplex without changing them to another layer? My room titles are Tahoma and room sizes are Simplex. My general text is Archstyl. I want to hide or freeze the Archstyl text but leave the room titles and sizes.

 

Any assistance would be appreciated!

 

John W.

0 Likes
Accepted solutions (1)
1,098 Views
12 Replies
Replies (12)
Message 2 of 13

hmsilva
Mentor
Mentor

Hi John,

are the objects only TEXT entities?

 

Henrique

EESignature

0 Likes
Message 3 of 13

johnw
Collaborator
Collaborator
Mostly Text but some MTEXT. The Tahoma Style and Simplex styles that I don't want to freeze are just TEXT also.
0 Likes
Message 4 of 13

hmsilva
Mentor
Mentor

What occurs to me is to select all TEXT, MTEXT, entities, cycle through the selection set, test the 'stylename' and set the 'visible' property to ':vlax-false'...

To restore do the inverse.

Please be aware 'stylename' property will have the AutoCAD TextStyle name, not the font name, and if MTEXT object as a STYLE overwritten it will fail...

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 5 of 13

johnw
Collaborator
Collaborator
Thanks Henrique, but I don't know how to use that programming language. I am only at a low-intermediate lisp programmer level. That's why I was hoping someone could show me how to do it.
0 Likes
Message 6 of 13

ВeekeeCZ
Consultant
Consultant

@hmsilva wrote:

What occurs to me is to select all TEXT, MTEXT, entities, cycle through the selection set, test the 'stylename' and set the 'visible' property to ':vlax-false'...

To restore do the inverse.

Please be aware 'stylename' property will have the AutoCAD TextStyle name, not the font name, and if MTEXT object as a STYLE overwritten it will fail...

 

Hope this helps,
Henrique


Hi guys... just an idea... how about use HIDEOBJECTS command? Easy to restore. Visible control on statusbar if anything hidden.

Message 7 of 13

hmsilva
Mentor
Mentor

@ВeekeeCZ wrote:

@hmsilva wrote:

What occurs to me is to select all TEXT, MTEXT, entities, cycle through the selection set, test the 'stylename' and set the 'visible' property to ':vlax-false'...

To restore do the inverse.

Please be aware 'stylename' property will have the AutoCAD TextStyle name, not the font name, and if MTEXT object as a STYLE overwritten it will fail...

 

Hope this helps,
Henrique


Hi guys... just an idea... how about use HIDEOBJECTS command? Easy to restore. Visible control on statusbar if anything hidden.


Yes, it would be easy to control...

 

Henrique

EESignature

0 Likes
Message 8 of 13

hmsilva
Mentor
Mentor

@Anonymous wrote:
Thanks Henrique, but I don't know how to use that programming language. I am only at a low-intermediate lisp programmer level. That's why I was hoping someone could show me how to do it.

John,

post a sample dwg, and tonight I'll see what I can do...

 

Henrique

EESignature

0 Likes
Message 9 of 13

johnw
Collaborator
Collaborator

Here is a floor plan example. Thanks a lot!

 

John

0 Likes
Message 10 of 13

Kent1Cooper
Consultant
Consultant

To find all of them [assuming what you're referring to is their Style name, not the Font assigned to their Style(s)]:

 

(setq ss (ssget "_X" '((0 . "*TEXT") (7 . "ARCHSTYL"))))

 

To make them invisible:

 

(repeat (setq n (sslength ss)) (vla-put-Visible (vlax-ename->vla-object (ssname ss (setq n (1- n)))) 0))

 

To make them visible again:

(repeat (setq n (sslength ss)) (vla-put-Visible (vlax-ename->vla-object (ssname ss (setq n (1- n)))) -1))

 

One benefit of this approach, as opposed to HIDEOBJECTS, is that if you happen to also have reason to hide any other objects than the Text you want hidden for this purpose, then when you UNHIDE, all of those other things will also come back on.

 

It could make sense to combine them into one command name, which could be built to toggle visibility [EDIT: see below], or one function name with some kind of tag argument for whether you want to hide or show them.

 

But personally, I would take the trouble to set up a different Layer for the room labels -- I expect you'd find it has benefits beyond just making it easier to do this kind of thing.

 

EDIT:  A simple Toggler command:

 

(defun C:TAV (/ ss vis); = Toggle ARCHSTYL Visibility
  (if (setq ss (ssget "_X" '((0 . "*TEXT") (7 . "ARCHSTYL"))))
    (progn
      (setq vis (vlax-get (vlax-ename->vla-object (ssname ss 0)) 'Visible))
      (repeat (setq n (sslength ss))
        (vla-put-Visible
          (vlax-ename->vla-object (ssname ss (setq n (1- n))))
          (if (= vis 0) -1 0)
        )
      )
    )
  )
)

 ... but @dbroad's point about the other related things remaining visible is a very good one [one of those "benefits beyond" that I expected there would be]....

Kent Cooper, AIA
0 Likes
Message 11 of 13

dbroad
Mentor
Mentor

I sincerely doubt any automation will help you with that drawing.  Hiding the text will leave the boxes, leaders and other artifacts related to the hidden text visible.  Some things must be done by hand.  Here is a command sequence using lisp but you should learn to manage visibility by ayer instead of  by hiding objects.  Suggestion:  Turn off layer text and move the room names to a new room names layer.

(command "hideobjects"
	 (ssget	"x"
		'((0 . "text,mtext")
		  (-4 . "<NOT")
		  (7 . "Tahoma,Simplex")
		  (-4 . "NOT>")
		 )
	 )
	 ""
)

Here is a screencast of how to do it with qselect

Architect, Registered NC, VA, SC, & GA.
Message 12 of 13

johnw
Collaborator
Collaborator
It might be easier just to copy the Tahoma text and Simplex text to another temp layer, freeze all the layers with text on them, print it and then revert back. Would that work? My guys just want to print a floor plan for a client and only show the room titles (Tahoma Style) and room sizes (simplex style). They don't do this too often and I don't want to create a permanent layer to put these on.

Ideas on how to accomplish this?
0 Likes
Message 13 of 13

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:
It might be easier just to copy the Tahoma text and Simplex text to another temp layer, freeze all the layers with text on them, print it and then revert back. Would that work? My guys just want to print a floor plan for a client and only show the room titles (Tahoma Style) and room sizes (simplex style). They don't do this too often and I don't want to create a permanent layer to put these on.

Ideas on how to accomplish this?

Make it easy on yourself and just create the permanent Layer.  It certainly will be easier than what you describe, and then the next time they need to print the same [there will be a next time, even if they don't do it too often], you won't have to go through the same rigmarole again, but can just turn a Layer off and back on.

 

You can find all Text in those Styles with the (ssget) part of @dbroad's suggestion in Post 11 with the (-4) lines removed.  The creation of the Layer and moving of them to it [whether your temporary idea or a permanent one] would be pretty simple, and could be done in several ways -- you can probably find examples of such things on the Forums.

Kent Cooper, AIA