Nico vd Schaaf Posted November 3, 2016 Share Posted November 3, 2016 I'd like to predefine a set of door widths in a popup list. The list however results in an integer like 0, 1, 2 etc. representing the number of options. How do I get the actual width of that option in an integer? If option 1 is selected width is 500 If option 2 is selected width is 600 If option 3 is selected width is 700 etc. Any help would be appreciated! Quote Link to comment
Marionette Maven Marissa Farrell Posted November 3, 2016 Marionette Maven Share Posted November 3, 2016 Attached is a modified Popup List node that does what you would like. If you need any help understanding this method, please let me know. Marionette_Post46263-popup_MFarrell.vwx 1 Quote Link to comment
Nico vd Schaaf Posted November 3, 2016 Author Share Posted November 3, 2016 Excellent! Quote Link to comment
AlanW Posted November 3, 2016 Share Posted November 3, 2016 Marissa correct me if I get this wrong. Using new nodes you will find at the top "#COMMAND;READONLYREFFILE;[VWLibDef]/Input\Point2.py;" and these nodes are read only. In Marissas node you will see this is missing giving you the ability to alter the node. Write your own text in line 7 and add more corresponding after line 20 to change the node to suite. Play with it and you will get the idea. HTH Quote Link to comment
Marionette Maven Marissa Farrell Posted November 3, 2016 Marionette Maven Share Posted November 3, 2016 Alan, you're correct that the line of code at the top prevents you from making edits to the node until you alter/remove it (more on altering it later...) This allows us internally to track changes made to the default content which we could not do before. Quote Link to comment
RDS Casa Posted November 28, 2017 Share Posted November 28, 2017 hello, this discussion is a little old now, I just wanted to check this is still the best way of making an adaptable pop up in the OIP? I messed about with Marissa's adapted pop up node, and I can get it to do what I need (I think)... but is this still the best way? I'll have to copy this special bastard node (sorry, I could not think of a better name! and semantically this is correct?) around multiple files, or save it to the marionette resource for use later? Why have the original node that is locked down? without the ability to change the pop up strings? and or their values? Thanks Marissa for the file, and Alan for highlighting how its different to its parent. Quote Link to comment
Marionette Maven Marissa Farrell Posted November 28, 2017 Marionette Maven Share Posted November 28, 2017 This is all still best practice. The default node is locked down for version control. If we took away the first line of code, it wouldn't be updated accurately between versions which could introduce problems. You can still use this node as long as you remove that first line of code and edit it in any way that you would like. Quote Link to comment
RDS Casa Posted November 28, 2017 Share Posted November 28, 2017 Thanks, I can get it to work for the first 3 options but not for any more options I add? The other options I've added display in the pop up, and I've added the following at the end of the script if input == 0: self.Params.output.value = 40 if input == 1: self.Params.output.value = 38 if input == 2: self.Params.output.value = 30 if input == 3: self.Params.output.value = 19 if input == 4: self.Params.output.value = 18 But only the 40, 38 and 30 work Is this restricted to 3 choices? or where am I going wrong? Also, Can I assume that the other intermediate inputs (radio buttons etc) can be bastardised in the same way? Thanks Quote Link to comment
RDS Casa Posted November 28, 2017 Share Posted November 28, 2017 Actually scrap that, its working fine now. Strange Thanks for your help Quote Link to comment
Marionette Maven Marissa Farrell Posted November 28, 2017 Marionette Maven Share Posted November 28, 2017 You'll need to add more choices up top. #OIP Controls input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, ['choice 1', 'choice 2', 'choice 3']) So in the line above, add more choices following the same format, i.e. #OIP Controls input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, ['choice 1', 'choice 2', 'choice 3', 'choice 4', ... 'choice n']) You can also change the names of those, so you can do #OIP Controls input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, ['my first choice', 'my second choice', etc.]) Quote Link to comment
Vectorworks, Inc Employee Stephan Moenninghoff Posted November 28, 2017 Vectorworks, Inc Employee Share Posted November 28, 2017 If you don't want to alter the popup node, this setup is helpful and I use it a lot now: The "Any" node receives your values. In my case it is textures so I have entered: ['Box-1', 'Box-2', 'Box-3', 'Box-4', 'Box-5', 'Box-6', 'Box-7', 'Box-8', 'Box-9', 'Box-10', 'Box-11', 'Box-12', 'Box-13'] In your case it's values, so you don't need the quotation marks. HTH Quote Link to comment
RDS Casa Posted November 28, 2017 Share Posted November 28, 2017 Thanks everyone, all making sense now. 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.