Announcement

Collapse
No announcement yet.

Yes, No dialog in Python

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Yes, No dialog in Python

    Hi,

    I can create a Taskdialog to display a message with:

    msgbox = TaskDialog
    msgbox.Show("My Title","My Message")

    This works fine, but I would like to add a Yes or No option to the dialog.

    According to the API help file for the TaskDialog class you can set default buttons and common buttons which I was expecting to set with this:

    msgbox = TaskDialog
    msgbox.CommonButtons = 1
    msgbox.Show("My Title","My Message")

    But I get the error message 'Attribute error: Static Property 'CommonButtons' of TaskDialog can only be assigned through a type, not an instance'

    I would appriciate some pointers on where I'm going wrong.

    Thanks

    #2
    Hello Archie,

    Unfortunately I'm not up with the play on Python yet, so this particular query may be better directed at the DynamoBIM forums themselves.

    Best of luck!

    Sol Amour

    Architectural Explorer, Digital warrior, Affectual adventurer and Curious Human Being
    Portfolio Website @ Cargo Collective

    Comment


      #3
      Thanks for your response, I sorted this out myself with:

      msgbox = TaskDialog
      msgbutton = TaskDialogCommonButtons.Yes | TaskDialogCommonButtons.No
      msgresult = TaskDialogResult.Yes | TaskDialogResult.No

      dismess = msgbox.Show("Title", "Message", msgbutton)


      Cheers.

      Comment

      Related Topics

      Collapse

      Working...
      X
      😀
      🥰
      🤢
      😎
      😡
      👍
      👎