HI Bentley Guys,If someone have string.replace function working example , please share.I am trying as below it's not working.Regards,Vivek
Hello Vivek,
Thanks for posting your query on plant forum.
Can you please confirm on which data type property you are using this custom attribute? Is it double or string?
Also, what the exact requirement here, where you want to use System.String.Replace
It would be great if you can log service request on this issue.
Regards | Deepak Singh
Thanks, Deepak,
system.string are always for string datatypes, i would like to change part of component description, with this ec expression.
if a ticket is required, i could create it, i thought it was quick fix.
I have posted a document I created that contains several examples using System.String (Others too). It can be found in the Files - OpenPlant folder in this Community. These were used in OpenPlant PID. These should work in OpenPlant Modeler as well.
This is does not contain every usage but does have several that I have had to create for other Bentley users. I hope this helps,
Tony DeRosa
Bentley Plant
Senior Application Engineer
I have tested this, and currently we do not support System.String.Replace.
What i suggest is to use a secondary property IE DESCRIPTION_ENTRY. Then, on the DESCRIPTION property, make the ECExpression an IIF statement.
So...
DESCRIPTION Property ECExpression:
IIF(this.DESCRIPTION_ENTRY="304","10","")
To protect the DESCRIPTION property, you could make it read only. The users would then enter the "description value" in the DESCRIPTION_ENTRY property, and this would drive the value published in the DESCRIPTION property.
With the IIF statement, you can also offer up several values:
IIF(this.DESCRIPTION_ENTRY="304","10","") & IIF(this.DESCRIPTION_ENTRY="404","20","").
I hope this helps,
Senior Consultant
Answer Verified By: Vivek Baraiya
Thanks Tony,I think I can, make use of substring to get our result.Regards,Vivek