本文整理汇总了C#中Annotation.GetFormatString方法的典型用法代码示例。如果您正苦于以下问题:C# Annotation.GetFormatString方法的具体用法?C# Annotation.GetFormatString怎么用?C# Annotation.GetFormatString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Annotation
的用法示例。
在下文中一共展示了Annotation.GetFormatString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: formatStringsAndAnnotations
public static void formatStringsAndAnnotations()
{
//Database db = AcadApp.DocumentManager.MdiActiveDocument.Database;
//// DataLinksManager dlm = DataLinksManager.GetManager(db);
Editor ed = AcadApp.DocumentManager.MdiActiveDocument.Editor;
//ObjectId entId = ed.GetEntity("Pick an SLINE TargetObject: ").ObjectId;
////Evaluate
//String sEval = Autodesk.ProcessPower.PnPCommonDbx.FormatStringUtils.Evaluate(
// "#(TargetObject.LineNumber^@NNN) - #(Project.General.Project_Name)",
// entId
//);
//ed.WriteMessage(sEval);
// Need to figure out how to get the Annotation Class and
// AnnotationFormatToolsUtil - This is out of date!
// use FormatStringUtils instead.
ObjectId annotationId = ed.GetEntity("Pick Annotation: ").ObjectId;
Annotation an = new Annotation(annotationId);
for (int ifs = 0; ifs < an.NumFormatStrings; ifs++)
{
String sfs = an.GetFormatString(ifs);
ObjectId targetId = an.TargetId;
// AnnotationFormatToolsUtil oUtil = new AnnotationFormatToolsUtil();
// FormatStringUtils oUtil = new FormatStringUtils();
//Evaluate
// String seval = oUtil.Evaluate(sfs, targetId); //WB commented
String seval = FormatStringUtils.Evaluate(sfs, targetId); //WB added
ed.WriteMessage(seval + " (" + sfs + ").");
}
}