Пример #1
0
        /// <summary>
        /// 生成标注
        /// </summary>
        public AnnotationBuildResult GenerateMultipleTagSymbol(Document document, IEnumerable <ElementId> selectedIds, MultiPipeAnnotationSettings setting, bool generateSingleOne)
        {
            if (selectedIds.Count() > AnnotationConstaints.PipeCountMax)
            {
                throw new NotImplementedException("暂不支持8根以上及管道的多管直径标注生成");
            }
            Document   = document;
            Collection = PAContext.GetCollection(Document);
            PipeAnnotationEntity entity = new PipeAnnotationEntity();

            entity.LocationType = setting.Location;
            View view = Document.ActiveView;
            AnnotationBuildResult result = GenerateMultipleTagSymbol(document, selectedIds, entity, setting);

            if (generateSingleOne && result == AnnotationBuildResult.Success)
            {
                Collection.Add(entity);
                Collection.Save(Document);
            }
            else if (result == AnnotationBuildResult.Success)
            {
                Collection.Add(entity);
            }
            return(result);
        }
Пример #2
0
 public void FinishMultipleGenerate(Document document)
 {
     if (Collection == null)
     {
         Collection = PAContext.GetCollection(Document);
     }
     Collection.Save(Document);
 }
Пример #3
0
 /// <summary>
 /// 取数据Collection
 /// </summary>
 /// <param name="doc"></param>
 /// <returns></returns>
 public static PipeAnnotationEntityCollection GetCollection(Document doc)
 {
     if (Collection != null)
     {
         return(Collection);
     }
     Collection = DelegateHelper.DelegateTryCatch(
         () =>
     {
         string data = ExtensibleStorageHelper.GetData(doc, CStorageEntity, CStorageEntity.FieldOfData);
         return(new PipeAnnotationEntityCollection(data));
     },
         () =>
     {
         return(null);
     }
         );
     return(Collection);
 }