public void CDS_CreateCivilDevDescriptionKeysAndForce() { using (Transaction tr = startTransaction()) { ObjectId keySetId = createOrRetrieveDescriptionKeySetAndForce("CivilDev"); PointDescriptionKeySet keySet = keySetId.GetObject(OpenMode.ForWrite) as PointDescriptionKeySet; ObjectId treesKeyId = createDescriptionKey(keySet, "TREE"); PointDescriptionKey key = treesKeyId.GetObject(OpenMode.ForWrite) as PointDescriptionKey; customizeDescriptionKey(key, "Tree", "Description Only", "$0 is a $1"); ObjectId wellsKeyId = createDescriptionKey(keySet, "WELL"); key = wellsKeyId.GetObject(OpenMode.ForWrite) as PointDescriptionKey; customizeDescriptionKey(key, "Well", "Point Number Only", "The $0 is $1"); tr.Commit(); } }
private ObjectId createDescriptionKey( PointDescriptionKeySet keySet, string code) { if (keySet.Contains(code)) { return(keySet[code]); } return(keySet.Add(code)); }