Hi All,
Is it possible to read a profile property with Grasshopper? I am trying to read the value of B2H from a custom profile in Tekla.
Thanks.
Hi All,
Is it possible to read a profile property with Grasshopper? I am trying to read the value of B2H from a custom profile in Tekla.
Thanks.
Hi Mario,
Here’s a script you can use in a C# component to get the profile item from the db (edited 2025-04-24 to return the property values of the specific input profile rather than the default values - this is quicker as well):
private void RunScript(string ProfileName, ref object ProfileItem)
{
var name = ProfileName;
var profileItem1 = new Tekla.Structures.Catalogs.LibraryProfileItem();
if (profileItem1.Select(name))
{
ProfileItem = profileItem1;
return;
}
var profileItem2 = new Tekla.Structures.Catalogs.ParametricProfileItem();
if (profileItem2.Select(name))
{
ProfileItem = profileItem2;
return;
}
Print("Profile not found");
}
Remember to add a reference to the Tekla.Structures.Catalogs.dll (in the bin folder of the Tekla version you’re using). Or download the example below.
Then you can expand the profile item and read the aProfileItemParameters values.
The above example definition here (dynamic script so you don’t even need Tekla references):
GetProfileProperties.gh (8.5 KB, updated 2025-04-24)
Cheers,
-b
Beautiful! It worked like a charmed!
You are a life saver as always Sebastian. Thanks heaps!
Hi Sebastian Lindholm!
it doesn’t work when we use beam plate PL600*50 for examble
I guess it will return the default property values for any parametric profile, if that’s what you’re referring to. Here’s a version that returns the actual values of the input profile:
GetProfileProperties.gh (8.5 KB)
-b
Would be nice if the Expand Object component could do all the steps.