@@ -125,12 +125,16 @@ Friend Class ExtensibleStorage
125125
126126 ' Create field1
127127
128- Dim fieldBuilder1 As FieldBuilder = _
129- builder.AddSimpleField( "SocketLocation" , GetType (XYZ)).SetUnitType(UnitType.UT_Length)
128+ Dim fieldBuilder1 As FieldBuilder =
129+ builder.AddSimpleField( "SocketLocation" , GetType (XYZ))
130+
131+ ' .SetSpec(SpecTypeId.Length) ' 2021
132+ ' GetType(XYZ)).SetUnitType(UnitType.UT_Length) ' 2020
130133
131134 ' Set unit type
132135
133- fieldBuilder1.SetUnitType(UnitType.UT_Length)
136+ 'fieldBuilder1.SetUnitType(UnitType.UT_Length) ' 2020
137+ fieldBuilder1.SetSpec(SpecTypeId.Length) ' 2021
134138
135139 ' Add documentation (optional)
136140
@@ -149,7 +153,8 @@ Friend Class ExtensibleStorage
149153
150154 Dim ent As New Entity(schema)
151155 Dim socketLocation As Field = schema.GetField( "SocketLocation" )
152- ent.Set( Of XYZ)(socketLocation, New XYZ( 2 , 0 , 0 ), DisplayUnitType.DUT_METERS)
156+ 'ent.Set(Of XYZ)(socketLocation, New XYZ(2, 0, 0), DisplayUnitType.DUT_METERS) ' 2020
157+ ent.Set( Of XYZ)(socketLocation, New XYZ( 2 , 0 , 0 ), UnitTypeId.Meters) ' 2021
153158
154159 Dim socketNumber As Field = schema.GetField( "SocketNumber" )
155160 ent.Set( Of String )(socketNumber, "200" )
@@ -189,9 +194,10 @@ Friend Class ExtensibleStorage
189194
190195 Dim wallSchemaEnt As Entity = wall.GetEntity(schema.Lookup(_guid))
191196
192- Dim wallSocketPos As XYZ = wallSchemaEnt.Get( Of XYZ)( _
193- schema.Lookup(_guid).GetField( "SocketLocation" ), _
194- DisplayUnitType.DUT_METERS)
197+ Dim wallSocketPos As XYZ = wallSchemaEnt.Get( Of XYZ)(
198+ Schema.Lookup(_guid).GetField( "SocketLocation" ),
199+ UnitTypeId.Meters) ' 2021
200+ ' DisplayUnitType.DUT_METERS) ' 2020 _
195201
196202 s = "SocketLocation: " + Format.PointString(wallSocketPos)
197203
0 commit comments