twitter youtube facebook linkedin email

IN THE PIPES

How to extract part of one property into another property

Dan Scales
July 16, 2015

Imagine you have a property that contains a data string, and you need to extract a section of the data into a new property.

How do you do it without having to manually enter the data into the new property?

It can be done by using the Substring function of the PLANTDEFINECALCPROPERTIES command:

So for example, you have a 6 digit property called TagCode for hand valves that includes a text prefix followed by a hyphen and then a number (eg, AA-101) and you would like to extract the number (101) into a new property without including the text prefix.

This can be achieved using the following syntax "Substring(TagCode,3,3)":

PlantDefineCalcProperties

The resulting calculated property, is a new property, called TagAnno that only includes the last 3 digits from the TagCode property:

Result

 

  • Featured Links

    Dan Scales

    Dan studied Construction at Sheffield Hallam University and Building Surveying at Heriot Watt University in Edinburgh. Joining Autodesk in 2000, Dan has provided support for a wide variety of Autodesk products and has been supporting Plant and P&ID since the very first releases. Prior to joining Autodesk, Dan gained experience working as a design draftsman for a number of consulting engineers in and around Edinburgh. Outside of work Dan enjoys riding motorcycles, road bikes and mountain bikes.

    '