Quantcast
Channel: OpenBuildings | AECOsim | Speedikon | Forum - Recent Threads
Viewing all articles
Browse latest Browse all 4872

Named Expression - System. String.Substring

$
0
0

Hello,

I am trying to create a named expression that will be used to control the display of context menus based on the model name prefix, (e.g. Sketch1, detail5.258, sectiont785) the user is in. My approach will only look at the prefixes and will include everything else after the prefix. I am wondering if anyone else has seen this issue before or how to fix it.

Below is the expression: (This expression works on correctly all models except the "Sketch" model. When testing in the "Sketch: model the result is "Can not evaluate expression.")

ActiveModel.Name = "Sketch" or
System.String.Substring(ActiveModel.Name, 0,8) = "building" or
System.String.Substring(ActiveModel.Name, 0,7) = "section" or
System.String.Substring(ActiveModel.Name, 0,6) = "detail"

I have tried many variations of this expression, Such as

ActiveModel.Name = "Sketch" and
System.String.Substring(ActiveModel.Name, 0,6) = "building" and
System.String.Substring(ActiveModel.Name, 0,7) = "section" and
System.String.Substring(ActiveModel.Name, 0,6) = "detail"

System.String.Substring(ActiveModel.Name, 0,6) = "Sketch" or
System.String.Substring(ActiveModel.Name, 0,8) = "building" or
System.String.Substring(ActiveModel.Name, 0,7) = "section" or
System.String.Substring(ActiveModel.Name, 0,6) = "detail"

and

(System.String.Substring(ActiveModel.Name, 0,6) = "Sketch" or
System.String.Substring(ActiveModel.Name, 0,8) = "building" or
System.String.Substring(ActiveModel.Name, 0,7) = "section" or
System.String.Substring(ActiveModel.Name, 0,6) = "detail")

Truncating the expression like this works but will not accomplish my end goal. I need the complete model names as there are different variations of these prefixes (i.e "building" and "build", and each require a different set of custom context menus).

System.String.Substring(ActiveModel.Name, 0,6) = "Sketch" or
System.String.Substring(ActiveModel.Name, 0,6) = "buildi" or
System.String.Substring(ActiveModel.Name, 0,6) = "sectio" or
System.String.Substring(ActiveModel.Name, 0,6) = "detail"

It appears that the System.String.Substring does not like different length sizes within the same expression. any ideas on how to get my named expression to function using the full model prefix?
 

Thanks

-Mike

System info
Windows 8
AECOsim Building Designer v10.00.00.154


Viewing all articles
Browse latest Browse all 4872

Latest Images

Trending Articles



Latest Images

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