wezelboy Posted November 7, 2007 Share Posted November 7, 2007 Is there a function that can set an objects text size attribute? This seems like it would be something obvious, but it escapes me. I'm still on 12.5 BTW. Thanks! Quote Link to comment
Pat Stanford Posted November 7, 2007 Share Posted November 7, 2007 SetTextSize will work with an object you have a handle to. You can wrap this in a ForEachObject function if you need to work on selected objects. Pat Quote Link to comment
wezelboy Posted November 7, 2007 Author Share Posted November 7, 2007 I thought SetTextSize was just for Text objects, but I will give it a shot. Thanks! Quote Link to comment
wezelboy Posted November 8, 2007 Author Share Posted November 8, 2007 Hmmm. This one isn't working for me. Is there a trick with the start and end parameters? Quote Link to comment
Pat Stanford Posted November 8, 2007 Share Posted November 8, 2007 What exactly are you trying to do? Can you post your code (or at least a snippet)? Pat Quote Link to comment
wezelboy Posted November 8, 2007 Author Share Posted November 8, 2007 Basically, I'm trying to set the text size attribute of door or window PIOs so that the text of the label is a certain size. It would be the equivalent of selecting a PIO and the choosing a font size from the text menu, except that I am going through all of the PIOs. I always thought that font and font size were attributes like pen size or line weight that could be applied to each object, but I can't find anything in VS to access or set these particular attributes. One possibility is from the Get/SetObjectVariable series, but I cannot find an appropriate selector for the font size attribute in the documentation. Quote Link to comment
Jonathan Pickup Posted November 8, 2007 Share Posted November 8, 2007 does your script actually create the text? if so you can use the TextSize(x); to set the text. Quote Link to comment
Pat Stanford Posted November 8, 2007 Share Posted November 8, 2007 Try DoMenuTextByName('Font Size',6); The number at the end is the selector (1-15) for the default font sizes from the pull down menu. This will work on all selected objects. If you want to work with handles, we will have to dig deeper and figure out how to get a handle to the text inside the Door/Window PIO. Pat Quote Link to comment
wezelboy Posted November 8, 2007 Author Share Posted November 8, 2007 does your script actually create the text? if so you can use the TextSize(x); to set the text. The text is created by the Door or Window PIO using whatever text attributes are attached to the PIO. I'm really surprised that there are not any functions that cover this. Quote Link to comment
wezelboy Posted November 8, 2007 Author Share Posted November 8, 2007 Try DoMenuTextByName('Font Size',6); I'll give this a shot. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.