(Using Revit 2013)
Hi all,
Could anyone suggest how i can write into my api to ask the user to select sheets in their current project.
I would like to launch the "Selected view/sheets" box up to the user to check the tick boxes and then use these results for the rest of my code.
I have read the "viewprinter" in the SDK samples but it seems to be very complex for what i imagine should be an easy task.
Note: I dont want to launch the print box just the view/sheet selection box.
Thanks in advance
Mike
Solved! Go to Solution.
Solved by R.van.den.Bor. Go to Solution.
How about :
Document doc = commandData.Application.ActiveUIDocument.Document;
UIApplication app = commandData.Application;
List<View> Views = new List<View>();
List<ViewSheet> ViewSheets = new List<ViewSheet>();
FilteredElementCollector coll = new FilteredElementCollector(doc);
ElementClassFilter filter = new ElementClassFilter(typeof(View));
coll.WherePasses(filter);
foreach (Element el in coll)
{
if (el is View)
{
Views.Add(el as View);
}
if (el is ViewSheet)
{
ViewSheets.Add(el as ViewSheet);
}
}
Remy, Thanks for the reply but not quite what i am after.
That records ALL the views and sheets in the project which i am fine with but i want to get the end user to select from a list the sheets which they want to export,print, etc.
I am trying to achieve the below pop up box using the API but dont want all the print settings to pop up.
Once the user has selected the appropriate sheets i want to use that selection list in the rest of my code.
Mike
Now I don't understand you. With my code you get a list of all the views in a project and all the sheets. With a filter the users can decide to see all the views, all the sheets or both. Then you let the user select with checkboxes what views/sheets he wants and you use that selection in your further code. Isn;t that what you want ??
Yes, you are right. You have to create your own dialogscreen, you can't call for this dialog. It's probably a good idea to have a look at the revit SDK first. The example allviews might be interesting for you aswell. Good luck,
Hi Mike, Did you end up creating this windows form? If so would you mind sharing your code on this thread as a solution to your original question?
There are many different ways to approach this 'let the user select sheets' case. The proper way would indeed be to create your own dialog. The total implementation however includes datastructures, databinding and more code that isn't really that Revit API related, and posting it here would probably lead to a lot of off-topic discussion.
Note: This isjust my two cents. I'm just an other forum user.
In the SDK there are a lot of examples with custom dialogs. As said, that would be a good place to start.