Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save benkoshy/a5709103ff10ad20ea26cf19bcfd3e68 to your computer and use it in GitHub Desktop.

Select an option

Save benkoshy/a5709103ff10ad20ea26cf19bcfd3e68 to your computer and use it in GitHub Desktop.
Tekla API - How to access a profile's property information e.g. Height, Width etc.
        public double getHeight(string profileString)
        {
            LibraryProfileItem libraryProfileItem = new LibraryProfileItem();
            libraryProfileItem.Select(profileString);

            List<ProfileItemParameter> parameters = libraryProfileItem.aProfileItemParameters.Cast<ProfileItemParameter>().ToList();
            double height = parameters.First(p => p.Property.ToUpper() == "HEIGHT").Value;

            return height;
        }
        
// and call it like so:

double height = getHeight("CC200*75*5.0");
// voila!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment