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 void customizeDescriptionKey(PointDescriptionKey key, string pointStyle, string labelStyle, string format) { key.StyleId = getPointStyle(pointStyle); key.LabelStyleId = getPointLabelStyle(labelStyle); key.Format = format; key.ApplyStyleId = true; key.ApplyLabelStyleId = true; }