Jump to content
Developer Wiki and Function Reference Links ×

popup


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

etc.

 

Any help would be appreciated!

 

Link to comment

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

Capture.JPG

Link to comment
  • 1 year later...

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.

 

 

Link to comment
  • Marionette Maven

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.

Link to comment

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

Link to comment
  • Marionette Maven

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

 

Link to comment
  • Vectorworks, Inc Employee

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.

 

5a1d95bf3c1a6_Bildschirmfoto2017-11-28um17_58_16.thumb.png.d8405e90a65bd46801e380a1f249b40a.png

HTH

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.

Guest
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...