Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        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;
            });
        }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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;
        }