Jump to content
Developer Wiki and Function Reference Links ×

Creating text with dropdown menu


Recommended Posts

I'm looking for a way to create a text and be able to click on this text and get a dropdown to change it's value.

I can't find a standard function within Vectorworks to do this and my knowledge of marionette is very limited but i have a feeling marionette might be the way to create this.

Is there someone who has en example for this?

  • Like 1
Link to comment
  • 1 month later...

Way easier to do this as a Plugin Object than to try and do it as Marionette.  As a PIO the script is only 5 lines long and only 1 line actually is not wrapper code.  The custom Marionette nodes you would need would be far longer.

 

With the Plugin you can use the Plugin Editor to change the choices from the Parameter screen.  If you need different objects with different choices you can simply duplicate the PIO and give it a different name.

 

The biggest downsides I can see to doing it this way is that you will have to edit your workspace to include this new object/tool. And probably make your own icon. I am not enough of an artist to even try to do that. The icon is set from the Properties pane of the Set Definition dialog box. It must be a 26x20 PNG or SVG graphic. I think there is also an option for a double size icon for higher resolution.

 

See the following Super Short Tutorials on creating the PIO and Editing the workspace.

SST-Make a PIO Point Object.pdf

SST-Add a Tool or Object to a Workspace Tool Paleete.pdf

 

Link to comment
On 5/24/2024 at 7:53 AM, DavidF said:

I'm looking for something similar. I would like to have the list choices in the pop-up dialog as a drop-down menu in the object info. Is it possible?

does the "Popup" node not do what u need?

 

The question here ist, what should be the output? The std. Node Popup outputs 0,1,2,3,4, depending on what coice u picked.

 

i modyfied this node with help from "chat gpt" so i got a node outputs the input as a string u selected.

Link to comment

#Modified April 2017 Made by CHAT Gpt with Kingchaos
@Marionette.NodeDefinition
class Params(metaclass = Marionette.OrderedClass):
#APPEARANCE
    #Name
    this = Marionette.Node( 'Popup String' )    
    this.SetDescription('This node demonstrates the use of a Popup OIP control. The values returned by this node will be integers based on your selection starting with 0 for the first option and increasing by 1 for consecutive options.')
    
    #Input Ports
    
    #OIP Controls
    input = Marionette.OIPControl( 'Popup', Marionette.WidgetType.Popup, 0, ['US-Endseite Preback RB V002', 'US-3er SK Dummymaterial SST Preback RB Koemacell V00', 'US-Doppeltuer Dummymaterial SST Preback RB Koemacell V00', 'US-Drehtuer Dummymaterial SST Preback RB Koemacell V01', 'US-Einzeltuer m BL Dummymaterial SST Preback RB Koemacel V00'])
    input.SetDescription('an OIP control representing the options designated within the script editor')
    
    #Output Ports
    output = Marionette.PortOut('s')
    output.SetDescription('a string representing the option selected in the OIP..')
    
#BEHAVIOR

def RunNode(self):
    #inputs
    input = self.Params.input.value
    
    #script
    options = ['US-Endseite Preback RB V002', 'US-3er SK Dummymaterial SST Preback RB Koemacell V00', 'US-Doppeltuer Dummymaterial SST Preback RB Koemacell V00', 'US-Drehtuer Dummymaterial SST Preback RB Koemacell V01', 'US-Einzeltuer m BL Dummymaterial SST Preback RB Koemacel V00']
    selection_index = int(input) # convert the string input to an integer index
    selection = options[selection_index] # get the corresponding option

    #outputs
    self.Params.output.value = selection
 

  • Like 1
Link to comment

if u name it u can have it in the ObjectInfoPalette of your marionette/wrapper/object-node

 

If that is what u need, try it.

 

I am 1 step further, i need the selection of symbols (in a specific folder) with pulldown in the oip 🙂 

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