Results 1 to 3 of 3
Like Tree3Likes
  • 1 Post By archie456
  • 2 Post By archie456

Thread: Yes, No dialog in Python

  1. #1
    Junior Member
    Join Date
    November 30, 2015
    Posts
    32
    Current Local Time
    02:51 AM

    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
    duende123 likes this.

  2. #2
    Member amoursol's Avatar
    Join Date
    November 21, 2012
    Location
    London, United Kingdom
    Posts
    464
    Current Local Time
    02:51 AM
    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!

  3. #3
    Junior Member
    Join Date
    November 30, 2015
    Posts
    32
    Current Local Time
    02:51 AM
    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.
    DMapes and amoursol like this.

Similar Threads

  1. Getting room location from Python
    By archie456 in forum Dynamo BIM
    Replies: 6
    Last Post: April 27th, 2016, 09:57 AM
  2. FamilyInstance.SetRotation within a Python script
    By ari.monteiro in forum Dynamo BIM
    Replies: 3
    Last Post: April 26th, 2016, 03:23 PM
  3. Dynamo and Python
    By rdon in forum Dynamo BIM
    Replies: 1
    Last Post: December 18th, 2015, 09:01 AM
  4. What Revit Wants: Python for Energy Modeling
    By luke.johnson in forum Blog Feeds
    Replies: 0
    Last Post: January 8th, 2012, 11:45 PM
  5. Buildz: Python Scripting in Vasari 2.1
    By Buildz in forum Blog Feeds
    Replies: 0
    Last Post: September 25th, 2011, 03:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •