DomC Posted January 24, 2017 Share Posted January 24, 2017 This Marionette Object Shows its layer name (last word) and the layer stacking order as a label. I often create documentation inside Vectorworks and do not want to use other applications for that. All we need is Vectorworks! Contains some custom nodes: 1. "GetAllLayer" A List of Design Layers and a List of Sheet Layers 2. "Backward" A node to send an object in background (did not fount a native node for that ..?) 3. "GetLastWord" split the last word from a string 4. "GetObject" Wrapper to grab a Text Object with a Text Style and to transport this Textstil by copy/paste the script Nothing spectacular but could be handy and really helps saving time compared to manually texting or stamping a counter on every layer. Also with the "GetLastWord" node, the layer can contain the chapter in his name. page_numbering.vwx Quote Link to comment
CookC Posted October 20, 2017 Share Posted October 20, 2017 Hi DomC Thank you for the file! I am currently trying to extract the first character from a string to be used to make a text object. I thought that I could alter your "GetLastWord" to do this. Would you be able to help me out on this? Thanks Quote Link to comment
twk Posted November 3, 2017 Share Posted November 3, 2017 (edited) In python, strings are treated as list objects. # So take for the example the string below some_string = "four" # in python strings can be thought of as lists # some_string = ['f','o','u','r'] # so to get the first character just use list slicing, calling the index of the character you are after in the string: some_string[0] # will be equal to 'f' # second string: some_string[1] # will be equal to 'o' # and so on.. # and to get the last character, use negative indices some_string[-1] # last character = 'r' hth, Tui Edited November 3, 2017 by twk 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.