Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
New to the API(and c# for that matter) but im getting somewhere with it.
I'm trying to get the FilteredElementCollector to filter sheets by SheetNumber.Contains(//user input//) which works just fine. But i would like it to add 1 sheet that will always be the same number "100-Temp".
I've tried everything to get the collector to add this sheet to its collection with the user defiend string (match) but my Sheet Set (which the code creates) never has this sheet added to it.
Document doc = this.ActiveUIDocument.Document;
// create a new ViewSet - add views to it that match the desired criteria
ViewSet myViewSet = new ViewSet();
string match = Microsoft.VisualBasic.Interaction.InputBox("Enter Unit Number", "Create Sheet Set", "");
string temp = "100-Temp";
if (match =="")
{
TaskDialog.Show("Error", "Cancelled or no information entered.");
return;
}
foreach (ViewSheet vs in new FilteredElementCollector(doc).OfClass(typeof(ViewSheet)).Cast<ViewSheet>()
.Where(q => q.SheetNumber.Contains(match ) ))
// .Where (q => q.SheetNumber.Equals(temp)))
{
myViewSet.Insert(vs );
}
Thanks!
Solved! Go to Solution.