Advertisement
Guest User

Untitled

a guest
Sep 21st, 2011
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.57 KB | None | 0 0
  1. private Double? GetElementLength(Element element)
  2. {
  3.     var lengthParam = Enum.GetValues(typeof (BuiltInParameter))
  4.                 .OfType<BuiltInParameter>()
  5.                 .Where(p => p.ToString().Contains("LENGTH"))
  6.                 .Select(param => element.get_Parameter(param))                
  7.                 .Where(param => param != null)
  8.                 .FirstOrDefault();
  9.  
  10.             if (lengthParam != null)
  11.             {
  12.                 var lengthValue = lengthParam.AsDouble();
  13.                 return lengthValue;
  14.             }
  15.  
  16.             return null;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement