Gets the value the for the user-defined property with a string data type.
Namespace: Autodesk.Civil.DatabaseServicesAssembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0
Syntax
Visual Basic |
---|
Public Function GetUDPValue ( _
udp As UDPString _
) As String |
Visual C++ |
---|
public:
String^ GetUDPValue(
UDPString^ udp
) |
Return Value
The UDP's string value.
Examples
CopyC#
1
2
3const string sampleClassificationName = "SampleClassification";
4UDPClassification sampleClassification = null;
5if (_civildoc.PointUDPClassifications.Contains(sampleClassificationName))
6{
7 sampleClassification = _civildoc.PointUDPClassifications[sampleClassificationName];
8
9}
10else
11{
12 sampleClassification = _civildoc.PointUDPClassifications.Add(sampleClassificationName);
13
14}
15
16
17
18AttributeTypeInfoInt typeInfoInt = new AttributeTypeInfoInt("Sample_Int_UDP");
19typeInfoInt.Description = "Sample integer User Defined Property";
20typeInfoInt.DefaultValue = 15;
21typeInfoInt.LowerBoundValue = 0;
22typeInfoInt.UpperBoundValue = 100;
23typeInfoInt.LowerBoundInclusive = true;
24typeInfoInt.UpperBoundInclusive = false;
25UDPInteger integerUDP = sampleClassification.CreateUDP(typeInfoInt);
26
27using (Transaction tr = startTransaction())
28{
29
30
31
32 ObjectId allPointsId = _civildoc.PointGroups.AllPointsPointGroupId;
33 PointGroup allPoints = allPointsId.GetObject(OpenMode.ForRead) as PointGroup;
34 allPoints.UseCustomClassification(sampleClassificationName);
35
36 ObjectId pointId = _civildoc.CogoPoints.GetPointByPointNumber(1);
37 CogoPoint point = pointId.GetObject(OpenMode.ForWrite) as CogoPoint;
38 int val = point.GetUDPValue(integerUDP);
39
40 write(String.Format("Point {0} Sample_Int_UDP={1}", point.PointNumber, val));
41
42 point.SetUDPValue(integerUDP, 0);
43
44
45 tr.Commit();
46}
CopyVB.NET
Exceptions
Exception | Condition |
---|
[!:System.InvalidOperationException] |
Thrown when the udp has not been initialized by the CogoPoint and the default value is not used by the udp.
|
See Also