willofmaine Posted August 31, 2017 Share Posted August 31, 2017 Is it possible to add prefixes and/or suffixes to the text (numeric values) displayed with a Marionette object? Attached is my "Attic Ventilation Calculator," which basically lets you draw the plan shape of a ventilated attic and then, based on the NFA of ridge and soffit vents, calculates how many linear feet of each of those is required. Rather than just displaying 100.00, 2.67 and 5.33, I'd like to make it display something like this: Attic Area: 100.00 SF Minimum Ridge Vent: 2.67 LF Minimum Soffit Vent: 5.33 LF Thanks! 03-Attic Ventilation Calculator-02.vwx Quote Link to comment
Pat Stanford Posted August 31, 2017 Share Posted August 31, 2017 Only if you convert the Number to Text and concatenate it all together. The Text node lets you add a prefix and suffix to a string. It will also take a Real value (number) as the string input and give you what you are looking for. Quote Link to comment
the frog Posted August 31, 2017 Share Posted August 31, 2017 or you can use the data part of the OIP. A long time ago (April 2016) with Marissa's help I made this script. Now not only the names appear but I can use the figures in the data base. The post was name 'Data base and OIP' rail script.vwx Quote Link to comment
willofmaine Posted September 1, 2017 Author Share Posted September 1, 2017 @Pat Stanford- I couldn't get what you're suggesting to work; I need to play with it more, which I want to do because I'd like to get a better understanding of the whole lists and concatenating thing... @the frog- I don't fully understand your script yet, however, I did see something in it that actually let me accomplish one possibility I'd considered for labeling the numbers in the Marionette object with separate, fixed-text prefixes: evidently, a "Pass" node can be used to combine two otherwise unrelated networks as a single network!(?). See attached. So, thanks for that! 04-Attic Ventilation Calculator-03.vwx Quote Link to comment
Pat Stanford Posted September 4, 2017 Share Posted September 4, 2017 Sorry to take so long to reply. Our youth soccer program is kicking off and just about imploded on Thursday. I have been head down to try and keep 900 kids happy and playing ever since. The Text node seems to automatically convert a number (real) to text and concatenate a prefix and a suffix. Almost too easy. Quote Link to comment
willofmaine Posted September 5, 2017 Author Share Posted September 5, 2017 Yes, very easy. So how come it won't work in a larger network? The prefix displayed with a Marionette object seems nonsensical. See attached screen movie & VW file... 06-Text Node Fails-05.vwx 07-Text_Node_Fails-06.mov Quote Link to comment
the frog Posted September 5, 2017 Share Posted September 5, 2017 Very easy when you know where to search, took me a while! Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted September 11, 2017 Vectorworks, Inc Employee Share Posted September 11, 2017 (edited) On 9/5/2017 at 10:11 AM, willofmaine said: Yes, very easy. So how come it won't work in a larger network? The prefix displayed with a Marionette object seems nonsensical. To explain what is happening in the video, when you use the Text node, you are converting the number and strings of the prefix and suffix to a Vectorworks text object. If you debug the network, you would see that the info going from that list would consist of a Vectorworks handle, and two numbers. What is being printed by the Print List node is the unique name of the handle, not the strings that make up the text object. For this example, I would use a list node to list your prefix, number value, and suffix, then send that through a Str node to create a single string, then add it to the list that you send to the print list node. I hope that helps! Edited September 11, 2017 by sbarrett Quote Link to comment
willofmaine Posted September 14, 2017 Author Share Posted September 14, 2017 Hi Sarah, thanks for your response & explanation. I guess I really need to get a handle on, well, handles, strings and names. In Pat's example, the Text node appears to spit out the Prefix, Number, and Suffix as expected. But in my network I guess it instead spits out the Handle for the Prefix, but then the Number and Suffix as expected? I attempted to do what you suggested, but I'm not quite getting it. What is the "Str" node? Thanks! Quote Link to comment
Marionette Maven Marissa Farrell Posted September 14, 2017 Marionette Maven Share Posted September 14, 2017 @willofmaine I'm going to offer an easier way to solve this without having to mess up your existing network too much - after your "Text" node, use the "Get String" node. I'll also try to explain better what's going on with your current network. Your text node is creating a Vectorworks text object, which is not a String type variable, which is what you really want. The Get String node that I am proposing will take the String variable that exists inside of that text object and pull it out just so you get the characters that make up that Text Object. The text object that you created gives a 'handle' (or a unique identifier for an object in your document) rather than the string because we use that handle to edit that specific object (for example, move, resize, change the text inside, etc.) Hopefully that makes at least a little bit of sense, but if it doesn't I'd be more than happy to get further into it (maybe even with a graphical demonstration ) Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted September 14, 2017 Vectorworks, Inc Employee Share Posted September 14, 2017 With Marissa's example, I believe you would have to attach a Delete node as well as the Get String node to the Text node. The reason is that both the Text node and the Print List node are create Text Objects and you only need the one being created by the Print List node. Quote Link to comment
willofmaine Posted September 14, 2017 Author Share Posted September 14, 2017 Ah... okay. So a text object is distinctly different from the text that it contains (i.e., its "string" of characters). And the List node can't make any more sense out of a text object than it could make out of, say, a rectangle or a square (though it does "try," and at least pulls the text object's handle, which is a string...). I think I've got it! So I updated my network accordingly, and it seemed to work, even without the Delete node suggested by Sarah (maybe the duplicated text objects just stacked on top of each other?). But when I added the Get String node (in my "Convert Text to String" wrapper) to the other two text objects, I ran into some odd behavior: when wrapping the network, it included unexpected inputs, and the Marionette object created with it didn't work as expected (no prefix or suffix for the second and third text objects). So, I went ahead and added the Delete nodes (included in the attached file), but still had the same problem. I have since concluded that the first time the network is copied and wrapped, things go awry, but the second time it's copied and wrapped, all works as expected (even without the Delete nodes). Is this not a bug?... See attached movie. Progress! (Bugs (or not) aside...). So Thank You! 11-First_Wrap_Fails-06.vwx 12-First_Wrap_Fails-11.mov Quote Link to comment
Vectorworks, Inc Employee SBarrettWalker Posted September 14, 2017 Vectorworks, Inc Employee Share Posted September 14, 2017 It looks like the first time you selected the network, a few of the string nodes didn't get selected with it, and the inputs that SHOULD have been connected to are the ones that showed up on the outside of the wrapper. I haven't been able to replicate that however. Your next step could be to start experimenting with the Set Text Properties and Set Character Properties nodes to position and format the text within the box. 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.