Jump to content
Developer Wiki and Function Reference Links Read more... ×

Recommended Posts

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



Any help would be appreciated!


Share this post

Link to post

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.



Share this post

Link to post

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.

Share this post

Link to post

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.



Share this post

Link to post

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.

Share this post

Link to post



 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?



Share this post

Link to post

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.])


Share this post

Link to post

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.




Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.