ChadL Posted June 5, 2021 Share Posted June 5, 2021 I am having difficulty getting text to insert different from the document defaults. I use the Set Char Properties, and set alignment there, but it only does it after the text has been inserted. So if I am Top Left justified in doc setting, it will insert it there, then change to the Center Center I set in the node, but the text stays where it was initially drawn. I don't see a node that can set the defaults, or anyway to change it before I get the text string. What am I missing? Thanks. Quote Link to comment
Antonio Landsberger Posted June 14, 2021 Share Posted June 14, 2021 Hi @ChadL, there is a Marionette Node called "Set Text Properties" which allows you to set the horizontal and vertical alignment, after placing the text object. H: 1 = Left, 2 = Center, 3 = Right, 4 = Justify V: 1 = Top of text box, 2 = top baseline, 3 = text centerline, 4 = bottom baseline, 5 = bottom of text box I hope this helps. Antonio 1 Quote Link to comment
ChadL Posted June 22, 2021 Author Share Posted June 22, 2021 Hi Antonio. The Set text properties has the same problem as you mentioned and I mentioned, they both set the alignment after the text is placed. I want to place the text with the alignment already set so the text is placed where I want it. Any ideas for that? Quote Link to comment
Pat Stanford Posted June 22, 2021 Share Posted June 22, 2021 If I were doing this in a script, I would save the attributes, change them to what I want, create the text, then change the attributes back. Quote Link to comment
Antonio Landsberger Posted June 28, 2021 Share Posted June 28, 2021 Hi @ChadL, is this what you're looking for? Text-align.vwx Quote Link to comment
ChadL Posted June 28, 2021 Author Share Posted June 28, 2021 @Antonio Landsberger I've thought about this kind of solution, but the problem is, this assumes the document default is left justified. If the document is anything other, then this doesn't work. Quote Link to comment
Antonio Landsberger Posted June 29, 2021 Share Posted June 29, 2021 (edited) I see. I will think about this and see what a good solution might look like. Thank you for bringing this to our attention. Revised answer: see below. Edited June 29, 2021 by Antonio Landsberger Quote Link to comment
Antonio Landsberger Posted June 29, 2021 Share Posted June 29, 2021 @ChadL To answer your initial question: No, there's no node with which you can currently change the text document settings. But it's pretty easy using the command vs.SetPrefInt() See also https://developer.vectorworks.net/index.php/VS:SetPrefInt and here https://developer.vectorworks.net/index.php/VS:Function_Reference_Appendix#apppref search for TextJustification and you will find all the info you need. I am still not fully clear on what the issue is. The text alignment that is applied after creating the text object is independent from the document settings. Now, if you wanted to chose a reference point on the text object which is not the same as the text alignment, that would be a different story. For example let's say the created text object has "center" as a horizontal alignment, but you want the right edge of the text object to be at a certain x-value. If this is not what you mean and still have questions, please upload an image or a video explaining what is happening in your document. Quote Link to comment
ChadL Posted July 1, 2021 Author Share Posted July 1, 2021 @Antonio Landsberger You have pinned what I have been wrongly trying to correct. Yes, what I want is to insert the text on a chosen reference point in the text. I never thought of that, so I was trying to figure out how to do it with alignments. How would one place text on a reference point, of my choosing, in the text field? Quote Link to comment
Antonio Landsberger Posted July 2, 2021 Share Posted July 2, 2021 @ChadL Would you rather have a single dropdown to select both the horizontal and the vertical component of the reference point (in the OIP of the text node) or would you rather have two dropdowns: one for the horizontal, one for the vertical component of the reference point? I think I would prefer the latter and have: vRef: low - middle - high hRef: left - middle - right Quote Link to comment
ChadL Posted July 2, 2021 Author Share Posted July 2, 2021 (edited) @Antonio Landsberger For the tool I'm making, I don't even want it as an option, I always want it to be placed in the center of the text. Edited July 2, 2021 by ChadL Quote Link to comment
Letti R Posted July 9, 2021 Share Posted July 9, 2021 (edited) Hello, if the text is always just centered you can also use the "get 2D Center" Node. Then the Network could look like this: This Network uses the 2D information of the text object and takes advantage of the fact that the 2D center of the text object is the same as the center of the text (or at least i hope it always is). Like this you dont have to worry about the vectorworks preferences. Notes: - The network shown above only works for inserting the text object at its center - Although the insertion point of the text object ist its center, the text can be aligned differently - You can change the "Get 2D Center" node to the "Get 2D Point" to use one of the 4 vertecies of the text object as the insertion point Edited July 9, 2021 by Letti R 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.