Gets the value the for the user-defined property with a double data type.

Namespace: Autodesk.Civil.DatabaseServices
Assembly: AeccDbMgd (in AeccDbMgd.dll) Version: 13.4.2516.0

Syntax

C#
public double GetUDPValue(
	UDPDouble udp
)
Visual Basic
Public Function GetUDPValue ( _
	udp As UDPDouble _
) As Double
Visual C++
public:
double GetUDPValue(
	UDPDouble^ udp
)

Parameters

udp
Type: Autodesk.Civil.DatabaseServices..::..UDPDouble
The UDP to get the value for.

Return Value

The UDP's double value.

Examples

CopyC#
 1// Check if classification already exists. If not, create it.
 2// 
 3const string sampleClassificationName = "SampleClassification";
 4UDPClassification sampleClassification = null;
 5if (_civildoc.PointUDPClassifications.Contains(sampleClassificationName))
 6{
 7    sampleClassification = _civildoc.PointUDPClassifications[sampleClassificationName];
 8    // sampleClassification = _civildoc.PointUDPClassifications["Inexistent"];  // Throws exception.
 9}
10else
11{
12    sampleClassification = _civildoc.PointUDPClassifications.Add(sampleClassificationName);
13    // sampleClassification = _civildoc.PointUDPClassifications.Add("Existent"); // Throws exception.
14}
15
16// Create new UDP.
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    // Assign classification to Point Group. In this case, we use
30    // the "_AllPoints" point group so we can use it with all points.
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    // val should be default (15)
40    write(String.Format("Point {0} Sample_Int_UDP={1}", point.PointNumber, val));
41
42    point.SetUDPValue(integerUDP, 0); // Works! Lower bound included.
43    // point.SetUDPValue(integerUDP, 100); // Throws! Upper bout not included.
44
45    tr.Commit();
46}
CopyVB.NET
1!ERROR: See log file!

Exceptions

ExceptionCondition
[!: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