How to use button event

How to use button event

Anonymous
Not applicable
469 Views
2 Replies
Message 1 of 3

How to use button event

Anonymous
Not applicable

I used 'In-Place Mass' function!!

 

uiapp=UIApplication(document.Application)
cmdId=RevitCommandId.LookupPostableCommandId(PostableCommand.InPlaceMass)
UIApplication.PostCommand(uiapp,cmdId)

 

The results of implementation are as follows.

캡처.PNG

1)How to push 'Ok' button?

2)How to set the default value to output 'Mass1'?

 

Thanks:)

0 Likes
470 Views
2 Replies
Replies (2)
Message 2 of 3

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @Anonymous ,

To push "OK" you can use the below code

 RevitCommandId Cid=RevitCommandId.LookupPostableCommandId(PostableCommand.InPlaceMass);
                uiapp.PostCommand(Cid);
                uiapp.DialogBoxShowing += new EventHandler<Autodesk.Revit.UI.Events.DialogBoxShowingEventArgs>(DialodBBOX);
 private void DialodBBOX(object sender, DialogBoxShowingEventArgs e)
        {
            e.OverrideResult((int)DialogResult.OK);
        }

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 3

Anonymous
Not applicable

I used Python to modify and execute the code.  But...not running...

uiapp=UIApplication(document.Application)
cmdId=RevitCommandId.LookupPostableCommandId(PostableCommand.InPlaceMass)
UIApplication.PostCommand(uiapp,cmdId)
            
uiapp.DialogBoxShowing(DialogBoxShowingEventArgs.OverrideResult(TaskDialogResult.Ok))

The following error has occurred....

캡처.PNG

0 Likes