Jump to content
Developer Wiki and Function Reference Links ×

Prefix & Suffix for Marionette Text

Recommended Posts

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





03-Attic Ventilation Calculator-02.vwx

Link to comment

@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

Link to comment
  • Vectorworks, Inc Employee
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 by sbarrett
Link to comment

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!

Link to comment
  • Marionette Maven



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 ;) )

Link to comment

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!





Link to comment
  • Vectorworks, Inc Employee

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.

Link to comment

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.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...