Revit API

Reply
Contributor
slecompte
Posts: 12
Registered: ‎01-27-2014
Message 1 of 17 (607 Views)

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

607 Views, 16 Replies
02-03-2014 01:24 PM

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.

Valued Contributor
aksaks
Posts: 92
Registered: ‎03-23-2009
Message 2 of 17 (571 Views)

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

02-04-2014 08:21 PM 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.

ADN Support Specialist
jeremytammik
Posts: 407
Registered: ‎08-20-2007
Message 3 of 17 (559 Views)

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

02-05-2014 05:11 AM 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

Contributor
slecompte
Posts: 12
Registered: ‎01-27-2014
Message 4 of 17 (547 Views)

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

02-05-2014 08:36 AM 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.
Valued Contributor
aksaks
Posts: 92
Registered: ‎03-23-2009
Message 5 of 17 (537 Views)

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

02-05-2014 08:56 PM 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.
Distinguished Contributor
PhillipM
Posts: 112
Registered: ‎01-30-2007
Message 6 of 17 (525 Views)

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

02-06-2014 09:26 PM 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

 

 

ADN Support Specialist
jeremytammik
Posts: 407
Registered: ‎08-20-2007
Message 7 of 17 (517 Views)

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

02-07-2014 05:34 AM 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

Contributor
slecompte
Posts: 12
Registered: ‎01-27-2014
Message 8 of 17 (512 Views)

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

02-07-2014 09:22 AM 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.

Active Member
12360montes
Posts: 6
Registered: ‎12-02-2005
Message 9 of 17 (489 Views)

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

02-09-2014 03:17 PM 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.
Active Member
12360montes
Posts: 6
Registered: ‎12-02-2005
Message 10 of 17 (487 Views)

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

02-09-2014 03:21 PM 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.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Revit Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Revit helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Revit

Twitter

Facebook

Blogs

Youtube