Accessing an individual value in a property data with multiple values

By Mikako Harada

Issue

I have a duct fitting, where I have attached many property sets.  I noticed that some of automatic properties, such as RectangularConnectorWidth and RectangularConnectorHeight, show the information as a form of a concatenated string with semicolon (;) as a delimiter. This is because the duct fitting has two connectors. For example, for an elbow with width x height of 36×24 to 30×24, it shows as 36.0;30.0 for width and 20.0;24.0 for height. 

I want to access to individual values in those string. How can we do that? 

Solution

You can use Split function in a formula property to separate a string with “;” as a delimiter.  The following shows an example:

MyString = "[RectangularConnectionWidth]"
MyArray = Split( MyString, ";", -1, 1 )
RESULT = MyArray(0)


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading