Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating custom Project Browser plugin - Views -apply Grouping and Sorting

17 REPLIES 17
Reply
Message 1 of 18
slecompte
3418 Views, 17 Replies

Creating custom Project Browser plugin - Views -apply Grouping and Sorting

My company has Views grouped via a discipline then subset along with family and type (Please see Example A.) so it was a bit of surprised when I went into the AllViews Sample and it listed much differently than what the view originally shown (see Example B.) versus what AllViews Sample had showed (see Example C) until I took off the formatting.

 

So in my quest to create a plugin that mirrors the Project Browser - how may I go into the Revit API to determine what the grouping, sorting settings are?  Then once that is determined what is the best way to take the listing of all the views and then apply that via a tree view?  I think the closest sample that can get me started is Revit 2014 SDK - Samples - All Views - but there doesn't seem to be anything on the formatting of the view structure within that code sample.

Tags (1)
17 REPLIES 17
Message 2 of 18
aksaks
in reply to: slecompte

Sorry I cannot help. It seems like you would need to be able to get to the Browser object and its filter settings. Maybe the reason for your idea is mainly to provide flexibility and quick convenience not present in the Browser, but if you had access to the Browser object and its filter settings then why not control the Browser as you need it with new settings on the fly instead of using existing settings to build a new Browser. Looking at your last image and assuming it is the early fleshing out of a sheet creation tool I wonder how you plan to get around the manual placement tasks required for sheet composition and also the book keeping task of which views are already used.  The standard Browser has all of those capabilities built into it. It just needs a convenient way to drive it for specific tasks, like the one I am thinking you are looking for. Your customization would not look like a new Browser. Instead it would be sets of controls that instantly manipulate how the Revit browser organizes the views needed for sheet composition in addition to having some task controls and settings.

Message 3 of 18
jeremytammik
in reply to: slecompte

Dear Stephen,

I am not aware of any functionality at all provided by the Revit API to determine any special ordering of views.

You would have to use other generic properties and relationships to set up the ordering you desire.

I cannot say whether the API provides all the information required to mirror the constellation displayed in the Project Browser.

I hope this help.

Best regards,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 18
slecompte
in reply to: aksaks

"if you had access to the Browser object and its filter settings then why not control the Browser as you need it with new settings on the fly instead of using existing settings to build a new Browser."

I'm basically trying to build a Project Browser that would allow me to duplicate multiple views which is not something allowed in the current Project Browser 2014 or any past since.
per this link here is a more detailed explanation of what I'm requesting: http://forums.autodesk.com/t5/Revit-API/Creating-a-custom-Project-Browser-plugin-Duplicating-views/m...
But in developing this it would be a nice to be able to go into the object model and determine grouping and sorting as was done via the current Project Browser. No doubt it was done C++ and was wondering if any code available that could be converted into a C# example?


"Looking at your last image and assuming it is the early fleshing out of a sheet creation tool." It is not but instead the sample under the Revit SDKs - AllViews.cs to demonstrate how to create sheets under views.

I'm looking for some more functionality to be added to this sample but doesn't seem to have been changed over the years.
Message 5 of 18
aksaks
in reply to: slecompte

Sorry, I think I see now what you want to do and I would have similar needs. The Revit SDK AllViews seems like it could be a starting point to provide all the view names. The new ViewDuplicateOption as mentioned would provide the essential duplicating methods.

I do not think you need access to the Browser filters at all. You?ll be looking at the Revit browser to see what filters to apply. It may also be that the filtering needs are based on standard text that can be coded in. This really looks doable.

If I understand this correctly this time it looks like four operations. First generate a culled view name list based on some filtering. Then selecting from that view name list. Then applying the renaming operation to each view name. Then performing the duplication process. This might be two datagridviews (the culled view list in one, the selected views and the new names for those views as two columns in the other) side by side separated by some process controls between the views that control how each datagridview maps to the next. The datagridviews have selection, ordering and cell editing capabilities built in to apply any necessary fine tuning to the rename step. The selected-to-new name list needs to be one datagridview to keep them synchronized. Adding columns to these to order by view type might be useful. Datagridviews may not be intended for this purpose but they work just fine used this way.
Message 6 of 18
PhillipM
in reply to: slecompte

Word of warning here:  

 

Replicating the current Revit Project Browser is a huge development project.  I know cause I've been there.  It is possible, but I thought it may take a month?  Well it took 6 lol.

 

For a video of what I achived click on this link

 

http://youtu.be/JqRV6SLjJrM

 

Cheers

 

Phillip

 

 

Message 7 of 18
jeremytammik
in reply to: PhillipM

Dear Phillip,

 

Thank you for your valuable advice and the nice video. Very impressive indeed.

 

Cheers,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 8 of 18
slecompte
in reply to: slecompte

aksaks-

 

I'm in agreement with everything you've said except up to the point - ....

 

"this might be two datagridviews"

 

I'm perfectly fine with one datagrid view with selected checkboxes for each row that display the name of each view.
Probably a combo box above it to filter the types of views.... Floor Plan, 3D View, Building Section, Schedule, Panel Schedule,

Hit a button and it would go and create the new views based on what's in the datagrid.

Everything I want to do afterwards like a textbox for prefix and suffix - I can figure out.
I just need to get started with populating the datagrid with the views as a sample and a way to FILTER it.
That's the big thing for me - how do I filter it?   Not even the AllViews Samples shows how I may do that.

 


PhillipM-
 
You've created a masterful, beautiful Revit Project Browser plugin - and has taken it way farther then I could have even dreamed of.  
I just wanted somebody to update the current AllViews sample to at least have filtering so I could farther study on what I needed to do in this instance.


Is the filtering based on what's in the view name or another property for the view?

 

Thank you for your helpful replies thus far.  I guess I should have said instead of formatting the Project Browser I should have used the word filter.

Message 9 of 18
12360montes
in reply to: slecompte

Of course, KiwiCodes is a great project browser. In fact, it is far more than a project browser. I tried it and worth buying. But if you only need to duplicate a project browser, I have done it in only one and a half weeks. I recommend the use of the Objectlistview (treelistview) from sourceforge.com. It´s easy and very powerful. Not as precious as kiwi, but is easy to show the data and it is free. I have done it in this sequence: First I collect all views, sheetviews, and schedules. I have duplicated the structure exactly as the browser copying all the windows, buttons and duplicating exactly the same functionality. (Add organization an all this things.) I have created new personal classes for views, sheets and vports (views positioned on sheets). In order to change a little its functionality. I create all this objects with the info collected from Revit. And as you can’t access the browser, I have now two different browsers, the Revit one and the personal one. I do all the assignments views and schedules, to sheets, reposition and renaming, copy and paste 2d elements from view to view and so. And when the user clicks Ok button the transformations are done. With all the functionality it took me three weeks, not fully dedicated. Only copying the browser half this time. The hardest thing is the graphical and interface, the rest is simple, and with Jeremy Tamik´s blog I found all I needed. (Thanks Jeremy!). I will ask my company if I can share the code, or at least part of it, but I can´t promise anything. Anyway it shouldn´t be difficult, I´m not a programmer, just a newbie. You should be able to do it in less than that. By the way, sorry for my English it´s not very good. Hope this helped.
Message 10 of 18
12360montes
in reply to: 12360montes

Of course, KiwiCodes is a great project browser. In fact, it is far more than a project browser. I tried it and worth buying. But if you only need to duplicate a project browser, I have done it in only one and a half weeks. I recommend the use of the Objectlistview (treelistview) from sourceforge.com. It´s easy and very powerful. Not as precious as kiwi, but is easy to show the data and it is free. I have done it in this sequence: First I collect all views, sheetviews, and schedules. I have duplicated the structure exactly as the browser copying all the windows, buttons and duplicating exactly the same functionality. (Add organization an all this things.) I have created new personal classes for views, sheets and vports (views positioned on sheets). In order to change a little its functionality. I create all this objects with the info collected from Revit. And as you can’t access the browser, I have now two different browsers, the Revit one and the personal one. I do all the assignments views and schedules, to sheets, reposition and renaming, copy and paste 2d elements from view to view and so. And when the user clicks Ok button the transformations are done. With all the functionality it took me three weeks, not fully dedicated. Only copying the browser half this time. The hardest thing is the graphical and interface, the rest is simple, and with Jeremy Tamik´s blog I found all I needed. (Thanks Jeremy!). I will ask my company if I can share the code, or at least part of it, but I can´t promise anything. Anyway it shouldn´t be difficult, I´m not a programmer, just a newbie. You should be able to do it in less than that. By the way, sorry for my English it´s not very good. Hope this helped.
Message 11 of 18
12360montes
in reply to: 12360montes

 
Message 12 of 18
12360montes
in reply to: 12360montes

Sorry for repeating my post. I was trying to add an attachment showing what I described, but it didn´t work. Als doesn´t work the options button. So it will be fine if someone could delete mya repeated messages.
Message 13 of 18
PhillipM
in reply to: 12360montes

Well Done 🙂

 

The tricky part that I found was catching all the interactions within Revit that a user may do and have that automatically update my KC Browser.  IE what happens if a user adds a view from teh ribbon or modifies a parameter of a view that needs to be instanatly reflected in the browser.

 

The other very trciky part is how you co ordinate all of this in a workshared environment.

 

Regards

Phillip

Message 14 of 18
matthew_taylor
in reply to: slecompte

Hiya,

I wonder if you're overlooking a new Revit 2014 API feature? (See below - quote from RevitAPI.chm.)

I use this to get the selected views to create multiple duplicates.

You'd need your own button on the ribbon to run the macro from. Applying a keyboard shortcut would add to the accessibility.

 

Query the selection, apply the view.CanViewBeDuplicated(dupOpt) to the views, ask the user what type of duplication to use (if there's more than one),  and you're there.

 

Cheers,

 

Matt

 

External commands now supported from Project Browser as active view

API commands and macros are now enabled when the Revit active view is the Project Browser.  

  • If there are actively selected elements in the Project Browser, these will be returned from UIDocument.Selection
  • However, add-ins cannot prompt for interactive selection when the Project Browser is the active view.
  • The enumerated type ViewType now has separate entries for ProjectBrowser and SystemBrowser to allow applications to deal with situations where the Project Browser is active.  These view types used to be returned as ViewType.Internal, so code which keys of off ViewType.Internal may need to be updated to also deal with these new types.

Note that API commands are still disabled when the active view is the MEP system browser. 

 


Cheers,

-Matt
_______________________________________________________________________________
Marking a post as a 'solution' helps the community. Giving a post 'Kudos' is as good as saying thanks. Why not do both?
Message 15 of 18
slecompte
in reply to: 12360montes

Hey 12360montes

 

Any chance you have some time to help me with just setting up the Objectlistview (treelistview) from sourceforge.com via WebEX?

I'm still getting a few errors (please note attachment) - did you have as many as well?

 

 

Message 16 of 18
Ken_Marsh
in reply to: slecompte

Those are only warnings about not having XML comments preceeding each public function.

 

You should be able to ignore them.  If you need them, preceeding each, type "///" (without the quotes) in VS and you will get a XML template preceeding the function you can fill out.  Then you should have no more warning.

 

Hope that helps.

Ken Marsh
Owner Marsh API
Message 17 of 18
jeremytammik
in reply to: Ken_Marsh

... or switch off the Visual Studio XML documentation setting.

 

Cheers,

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 18 of 18
ngerasim
in reply to: jeremytammik

Not to duplicate this very important topic, the main issue is with schedules. Why on Earth we still cannot organize them?

Kiwi plug-in has this functionality (among many others), why not to release a free add-on or macros which only allows us to assign parameters to shedules and sort them in the browser? Just a third bookmark in the "browser organisation" function. Please, gurus, you are our last hope!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community