MicroStation V8i SS4, ProjectWise Environment
I am trying to create a named expression that is comparing specific letters noted in a named expression and in the _DGNFILE variable or the active file name to populate a menu item. I need to use the out of the box config var since I am in ProjectWise and I do not want the application to restart everytime I open a file.
What I have is always resulting in a False and I am not understanding why considering I thought I had the expression correct.
The file name is "01-CDM-PublishDevelopment-001.dgn". Here is what I have so far....
System.String.Compare(System.String.SubString(ConfigVar.GetExpandedConfigVar("_DGNFILE"),4,3),"CDM")
I want it to see tha the file I have open has CDM in this specific spot in the file name and then report back True and then show a specific set of tools based on that file name. Any ideas to do this with out of the box configuration vars is much appreciated however I would really prefer to use _DGNFILE to resolve the expression.
Thanks!
Mark W.
Unknown said:System.String.Compare(System.String.SubString(ConfigVar.GetExpandedConfigVar("_DGNFILE"),4,3),"CDM")
For testing, what happens if you substitute the literal file name instead of the config. variable?
System.String.Compare(System.String.SubString("01-CDM-PublishDevelopment-001.dgn",4,3),"CDM")
Regards, Jon Summers LA Solutions
same result
The indexes are zero-based, e.g. the first character is at index zero. So I'm thinking your SubString should be (string, 3, 3).
.
Should work as you had it but with the start index of 3. It returns True for me.