Quantcast
Channel: All Revit API Forum posts
Viewing all articles
Browse latest Browse all 66692

Re: search all elements containing sepecific string i.e. ABC

$
0
0

thanks mostafa90 for your quick reply, I did quick test, seems it's a bit slow, and only cover parameter side of element, I used the following code, seems working OK, but don't know if it's 100% covered.

 

foreach (Element e in all)
{
  if (e.Name.Contains("ABC"))
  {
   searched.Add(e);
   continue;
  }
  foreach (Parameter p in e.Parameters)
  {
   string n = p.AsString();
   if (string.IsNullOrEmpty(n)) continue;
   if (n.Contains("ABC"))
   {
    searched.Add(e);
    continue;
   }
  }
  // anything else?
}


Viewing all articles
Browse latest Browse all 66692

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>