Hello,
After renaming SheetNumber with Revit API, the project browser still shows the old name.
When selecting the Sheet, the new SheetNumber is shown in the properties panel, but not in the projectbrowser.
When remaing 100 sheets with Revit API, I only need to edit 1 manually for all sheets te be show properly in de projectbrowser.
HOW TO REFRESH THE PROJECTBROWSER BY REVIT API?
I have tried Class 'BrowserOrganization', but is seems only to be able to read stuff, not to change the browserorganisation.
please help.
greetings from the Netherlands,
Chris Hanschen, LKSVDD architecten BV. (Hengelo)
Solved! Go to Solution.
Solved by Sean_Page. Go to Solution.
Solved by matthew_taylor. Go to Solution.
I have seen the same issue and am curious to see if anybody has resolved it.
Hello Matthew,
My Topic has a red arrow saying: "This topic has been escalated"
do you know wat that meens?
I am from holland, so English is not my motherlanquage, but when i translate is, it means that it is in someway out of control.
Why? when 1000 people responded, I would understand, but now i do not have a clue.
Chris
Hi Chris,
This forum is monitored by Autodesk employees. Perhaps 'escalated' means that this bug has been reported to the Revit API developers?
-Matt
Hi Chris,
I'm afraid there is no UI related API like refresh browser. Sorry.
You may want to add this to Idea Station for Revit so that you can get votes from other community members:
http://forums.autodesk.com/t5/revit-ideas/idb-p/302/tab/most-recent
So, postcommand can be the workaround.
Workflow:
Sheet number is accurately renamed.
I've found another way to do this, without user input.
'Note the hardcoded element Id. You'll need to fix that - it was just for testing. Dim projBrowser As DB.View = TryCast(doc.GetElement(New DB.ElementId(258)), DB.View) Dim sheet As DB.ViewSheet = 'your sheet Using trans As New DB.Transaction(doc, "Rename Sheet") trans.Start() projBrowser.HideElements(New List(Of DB.ElementId) From {sheet.Id}) sheet.SheetNumber = "New Sheet Number" projBrowser.UnhideElements(New List(Of DB.ElementId) From {sheet.Id}) trans.Commit() End Using
I found that wrapping the unhide in a separate transaction caused a few issues, so I'd recommend against that.
Also, the Revit 'undo' stack didn't always behave like you'd expect it. So do some testing!
Let me know if you get it sorted.
-Matt
That sounds hopeful..!!!
As you describe it, the project browser is a view, type of Autodesk.revit.db.view.
How to get that view?
I Tried this with the standard Autodesk 'Simple Project' in Revit 2017:
Dim MyElementCollectorVIEWS As FilteredElementCollector = New FilteredElementCollector(MyDoc)
MyElementCollectorVIEWS.OfCategory(BuiltInCategory.OST_Views)
Dim temp As String = "*"
For Each MyView As Autodesk.Revit.DB.View In MyElementCollectorVIEWS
temp = temp & vbCrLf & MyView.Name
Next
temp = temp & vbCrLf & "*"
but it returns these views:
*
Level 1
North
East
West
Site
Architectural Reflected Ceiling Plan
Architectural Elevation
Architectural Section
South
Building Section
Level 2
Longitudinal Section
Kitchen
From Yard
Living Room
Stair Section
Approach
Section Perspective
Typ. Wall Section
Typical Wall Roof Connection
Typical Floor Wall Connection
Typical Foundation Detail
Main Stair Detail
Solar Analysis
Approach
From Yard
{3D}
E,S,D - Highlight Learning Content
Architectural Plan
Plan - Highlight Learning Content
Site Plan
Highlight Learning Content
3D View
Kitchen
Living Room
Section Perspective
*
I can't find the project browser view like this.
i also tried to get it from browserorganisation, but there is no 'GetProjectBrowser' or something like that.
can you help me out?
This should do it (tested in 2016):
Dim projectBrowser As DB.View = New DB.FilteredElementCollector(doc).OfClass(GetType(DB.View)).Cast(Of DB.View).Where(Function(v) v.ViewType = DB.ViewType.ProjectBrowser).FirstOrDefault
-Matt
In Holland (The Netherlands) we would say: "Dat werkt als een tierelier..!!"
It means: "It's work perfectly fine...!!"
Thanks a lot..!!!!!
No problem - glad you got it working!
I've had this issue myself in the past, so I'm sure I'll use the solution at some point. 🙂
A simpler solution is to hide the entire project browser, rename sheets as required then show the project browser again - it works for me anyway.
DockablePaneId dpId = DockablePanes.BuiltInDockablePanes.ProjectBrowser; DockablePane pB = new DockablePane(dpId); pB.Hide(); // rename here pB.Show();
Thanks Chris, this solved yet another mystery. Works perfectly. Dale
Thought I would share that you can shorten then even further by just using the Show() method without having to hide it first. This is enough to cause the browser refresh.
using (Transaction transaction = new Transaction(doc);
{
transaction.Start("Renumber Sheets");
sheet.SheetNumber = newSheetNumber;
transaction.Commit();
}
DockablePaneId dpId = DockablePanes.BuiltInDockablePanes.ProjectBrowser;
DockablePane dP = new DockablePane(dpId);
dP.Show();
If you'll excuse a really basic question-- when I see code like this, how to I use it in Dynamo? I've just been using prebuilt nodes up until now.
A question like this would probably be more applicable to the Dynamo forums https://forum.dynamobim.com/, but I think this code has to be used outside of an active transaction which will make utilizing it in Dynamo more challenging. Are you not seeing the changes happen in your model?
The simple answer is to use something like https://forums.autodesk.com/t5/forums/replypage/board-id/160/message-id/41275
...and make a Python code block. But it's never that simple... 😉 Once you run into a Python/Dynamo issue, @Sean_Page is right on the money.
Can't find what you're looking for? Ask the community or share your knowledge.