Results 1 to 4 of 4

Thread: ShowDialog

  1. #1
    All AUGI, all the time
    Join Date
    2007-09
    Location
    Raleigh NC
    Posts
    755
    Login to Give a bone
    0

    Default ShowDialog

    I'm trying to simply show a dialog, here is my code...

    Code:
    namespace HelloWorld
    
    {
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Automatic)]
    public class Class1 : IExternalCommand
    {
    public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,
    ref string message, ElementSet elements);
    
    public void ShowMyDialogBox()
    {
    Form1 frm = new Form1();
    frm.ShowDialog();
    }
    }
    }
    I've started with the HelloWorld sample. The debugger is getting caught on 'Execute' (see attached). Any ideas? Thanks.
    Attached Images Attached Images

  2. #2
    Member
    Join Date
    2011-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: ShowDialog

    Quote Originally Posted by bryan.thatcher View Post
    I'm trying to simply show a dialog, here is my code...

    Code:
    namespace HelloWorld
    
    {
    [Autodesk.Revit.Attributes.Transaction(Autodesk.Revit.Attributes.TransactionMode.Automatic)]
    public class Class1 : IExternalCommand
    {
    public Autodesk.Revit.UI.Result Execute(ExternalCommandData revit,
    ref string message, ElementSet elements);
    
    public void ShowMyDialogBox()
    {
    Form1 frm = new Form1();
    frm.ShowDialog();
    }
    }
    }
    I've started with the HelloWorld sample. The debugger is getting caught on 'Execute' (see attached). Any ideas? Thanks.
    You have a class Class1 This class have function Execute. This function must have a body, because this class is not abstract, extern or partial.
    So, remove semicolon after declaring Execute function. In body of this function call ShowMyDialogBox(). And don't forget to return value.

    Good luck, Victor.

  3. #3
    All AUGI, all the time
    Join Date
    2007-09
    Location
    Raleigh NC
    Posts
    755
    Login to Give a bone
    0

    Default Re: ShowDialog

    Would you be willing to post an example. I'm learning, thanks.

  4. #4
    Member
    Join Date
    2011-07
    Posts
    4
    Login to Give a bone
    0

    Default Re: ShowDialog

    Sure.

    Here is the code

    But I think you must read something for C# programming at first.

    Also read this lessons http://usa.autodesk.com/adsk/servlet...12&id=16777469

    You can see Tutorial video there. I think it helps you.

    Good luck

Similar Threads

  1. ShowDialog() Issue
    By Pwned555402908 in forum Dot Net API
    Replies: 1
    Last Post: 2011-10-23, 08:57 PM
  2. ShowDialog
    By Bryan Thatcher in forum Dot Net API
    Replies: 3
    Last Post: 2011-09-14, 03:40 PM

Posting Permissions

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