Using the status prompt in Revit

Using the status prompt in Revit

Anonymous
Not applicable
2,666 Views
5 Replies
Message 1 of 6

Using the status prompt in Revit

Anonymous
Not applicable

Does anybody know if (and how) it is possible to use the status prompt for your own custom messages ?

 

When you let your user select some elements, you can use the statusprompt easely like so :

 

IList<Element> PickSelection= sel.PickElementsByRectangle("Select by rectangle my highly appreciated user");

 

But what if I want to use the status prompt for telling the user a certain action has ended. What I am trying to avoid is an anoying message box to inform the user an action has ended.

 

Is there soemthing like StatusPrompt.Show("Action completed"); ?

 

 

0 Likes
Accepted solutions (2)
2,667 Views
5 Replies
Replies (5)
Message 2 of 6

augusto.goncalves
Alumni
Alumni
Accepted solution
Message 3 of 6

Revitalizer
Advisor
Advisor
Accepted solution

Hi Remy,

 

if you just want to display a message in a non-blocking manner,

you also could use a BalloonTip.

 

To use this, add a reference to AdWindows.dll to your VS project.

You can find it in the Revit program folder.

 

Then you could do this, for example as a static method in a "Utils" class:

 

public static void ShowBalloonTip(string category, string title, string text)
{
    Autodesk.Internal.InfoCenter.ResultItem ri = new Autodesk.Internal.InfoCenter.ResultItem();

    ri.Category = category;
    ri.Title = title;
    ri.TooltipText = text;    
    
    // optional: provide a URL, e.g. a website containing furter information
    ri.Uri = new System.Uri("http://www.yourContextualHelp.de");
    
    ri.IsFavorite = true;
    ri.IsNew = true;

    // you also could add a click event
    ri.ResultClicked += new EventHandler<Autodesk.Internal.InfoCenter.ResultClickEventArgs>(ri_ResultClicked);

    Autodesk.Windows.ComponentManager.InfoCenterPaletteManager.ShowBalloon(ri);
}

private static void ri_ResultClicked(object sender, Autodesk.Internal.InfoCenter.ResultClickEventArgs e)
{
    // do some stuff...
}   

 

Note that using functions of Revit's AdWindows.dll is not supported by Autodesk officially.

But since AutoCAD has its own version of that library, which is used by ACAD developers since many years, it seem to be a valid way.

http://through-the-interface.typepad.com/through_the_interface/2008/04/the-new-ribbonb.html

 

 

Cheers,

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 4 of 6

m.de.vriesTH5VM
Enthusiast
Enthusiast

I am using the suggested method for overwriting the status text to show the users of my addin that a long list of items is being processed ( SetStatusText($"Processing {idx++}/{total} file {fname}"); )

 

This works as it should but I get complaints from users that sometimes it does not update the status text after the first, so it will continue showing "Processing 1/1147 file test.rfa" even though the addin code keeps looping through the list and updates all 1147 files.

 

is there a known condition in the C# api that may cause Revit to not update the status text through the user32.dll SetWindowText?

0 Likes
Message 5 of 6

RPTHOMAS108
Mentor
Mentor

It is a very old link and likely always unsupported.

 

What happens when Revit want's to set it's own status bar text, this is probably part of the issue. Perhaps you are getting a blocking situation.

 

I would say use modeless child window with status bar but those aren't always easy to get working (in terms of updating). You can then also have a cancel button however.

0 Likes
Message 6 of 6

Speed_CAD
Collaborator
Collaborator

...

Mauricio Jorquera
0 Likes