public static bool IsElementOfCatalogType(this BCOM.Element comElement, string catalogTypeName) { Element element = ElementHelper.getElement(comElement); using (var catalogEditHandle = new CatalogEditHandle(element, true, true)) { if (catalogEditHandle != null && catalogTypeName.Equals(catalogEditHandle.CatalogTypeName, StringComparison.OrdinalIgnoreCase)) { return(true); } } return(false); }
public void AddProjection() { if (IsProjectionAdded_) { return; } CatchExceptionsByMessageCenter(() => { IEnumerable <ProjectionInfo> projInfoList = GetProjectionInfoList(); foreach (ProjectionInfo projInfo in projInfoList) { BCOM.Level level = ElementHelper.GetOrCreateLevel(projInfo.LevelName); FrameList.AddProjection( projInfo.Element, projInfo.ProjectionName, level); } IsProjectionAdded_ = true; }); }
public static void AddProjection(this TFCOM.TFFrameList frameList, BCOM.Element element, string projectionName, BCOM.Level level) { TFCOM.TFProjectionList tfProjection = AppTF.CreateTFProjection((string)null); tfProjection.Init(); element.Level = level; ElementHelper.setSymbologyByLevel(element); tfProjection.AsTFProjection.SetDefinitionName(projectionName); tfProjection.AsTFProjection.SetEmbeddedElement(element); tfProjection.AsTFProjection.SetIsDoubleSided(true); TFCOM.TFProjectionList projectionList = frameList.AsTFFrame.GetProjectionList(); if (projectionList == null) { frameList.AsTFFrame.SetProjectionList(tfProjection); } else { projectionList.Append(tfProjection); } }
private bool addToModel_(BCOM.ModelReference model = null) { model = model ?? App.ActiveModelReference; BCOM.Level level = ElementHelper.GetOrCreateLevel(LevelName); App.ActiveSettings.SetByLevel(level); BCOM.Element element; FrameList.GetElement(out element); if (element.ID != 0 && element.ModelReference == model) { return(true); } FrameList.AddToModel(model); FrameList.GetElement(out element); bool res = element.ID != 0; return(res); }
public bool AddToModel(bool recoverSettings = true, BCOM.ModelReference model = null) { model = model ?? App.ActiveModelReference; bool res = false; CatchExceptionsByMessageCenter(() => { if (recoverSettings) { ElementHelper.RunByRecovertingSettings(() => { res = addToModel_(model); }); } else { res = addToModel_(model); } // DataGroup свойства: res |= SetDataGroupInstance_(); }); return(res); }
public void Initialize() { if (IsInitialized_) { return; } BCOM.Level level = ElementHelper.GetOrCreateLevel(LevelName); FrameList = new TFCOM.TFFrameListClass(); IEnumerable <BCOM.Element> bodyElements = GetBodyElements(); foreach (BCOM.Element element in bodyElements) { element.Level = level; ElementHelper.setSymbologyByLevel(element); FrameList.Add3DElement(element); } FrameList.SetName(CellName); IsInitialized_ = true; }