示例#1
0
        public static bool IsPenetrationCell(this BCOM.Element element)
        {
            if (!element.IsCompundCell())
            {
                return(false);
            }

            var cell = element.AsCellElement();

            return(cell.Name == PenConfigVariables.CellName.Value ||
                   cell.Name == PenConfigVariables.CellNameOld.Value);
        }
示例#2
0
 public void LocateFilter(BCOM.Element Element, ref BCOM.Point3d Point, ref bool Accepted)
 {
     if (Element.IsCellElement())
     {
         if (Element.AsCellElement().Name == "Embankment" || Element.AsCellElement().Name == "RetainWall" ||
             Element.AsCellElement().Name == "Pond" || Element.AsCellElement().Name == "Road" ||
             Element.AsCellElement().Name == "OpenChannel" || Element.AsCellElement().Name == "Dike")
         {
             AddInMain.ComApp.ShowPrompt("GeoTag element selected, data point to accept.");
             Accepted = true;
         }
     }
 }
        public void DataPoint(ref BCOM.Point3d Point, BCOM.View View)
        {
            points_[pointIndex_++] = app_.Point3dFromXY(Point.X, Point.Y);

            if (pointIndex_ > 2)
            {
                // TODO в модель
                BCOM.Element leader = createLeader();

                leader.ScaleUniform(leader.AsCellElement().Origin,
                                    1 / ElementHelper.getActiveAnnotationScale());

                // ! перед добавлением в модель
                mdlCell_setIsAnnotation((int)leader.MdlElementDescrP(), 1);
                //leader.AsCellElement().ScaleUniform();


                app_.ActiveModelReference.AddElement(leader);

                var propHand = app_.CreatePropertyHandler(leader);
                propHand.GetAccessStrings();
                propHand.SelectByAccessString("AnnotationPurpose");
                if ((bool)propHand.GetValue())
                {
                    propHand.SelectByAccessString("IsAnnotation");
                    propHand.SetValue(true);
                }

                leader.Rewrite();
                app_.ActiveModelReference.PropagateAnnotationScale();

                //var res = mdlCell_setAnnotationScale(leader.MdlElementDescrP(), ElementHelper.getActiveAnnotationScale());

                PenetrLocateCmd.StartCommand();
            }
        }
示例#4
0
        public static void selectZons(ref BCOM.ElementEnumerator oEnum, ref DataZone oSelZone)
        {
            BCOM.Element oElem = default(BCOM.Element);

            List <BCOM.Element> MVFlyingStays = new List <BCOM.Element>();

            //MVFlyingStay

            Program.MSApp.ActiveModelReference.UnselectAllElements();

            while (oEnum.MoveNext())
            {
                oElem = oEnum.Current;
                //Debug.Print CStr(oEnum.Current.ID.high) & CStr(oEnum.Current.ID.low)

                switch (oElem.Type)
                {
                case BCOM.MsdElementType.CellHeader:
                    //Cells

                    switch (oElem.AsCellElement().Name)
                    {
                    case "001":
                        //LVStays
                        oSelZone.LVStays.Add(oElem.ID, oElem);       // (oElem, Convert.ToString(oElem.ID));
                        break;

                    case "002":
                        //LVStruts
                        oSelZone.LVStruts.Add(oElem.ID, oElem);
                        break;

                    case "003":
                        //MVStays
                        oSelZone.MVStays.Add(oElem.ID, oElem);
                        break;

                    case "004":
                        //MVStruts
                        oSelZone.MVStruts.Add(oElem.ID, oElem);
                        break;

                    case "005":
                        //TRFRCircles
                        oSelZone.TRFRCircles.Add(oElem.ID, oElem);
                        break;

                    case "006":
                        //TRFRNameplates"
                        oSelZone.TRFRNameplates.Add(oElem.ID, oElem);
                        break;

                    case "009":
                        //LVpoles"
                        oSelZone.LVpoles.Add(oElem.ID, oElem);
                        break;

                    case "010":
                        //MVpoles"
                        oSelZone.MVpoles.Add(oElem.ID, oElem);
                        break;

                    case "011":
                        //MVSharingPoles
                        oSelZone.MVSharingPoles.Add(oElem.ID, oElem);
                        break;

                    case "012":
                        //KickerPoles"
                        oSelZone.KickerPoles.Add(oElem.ID, oElem);
                        break;

                    case "015":
                        //LVFlyingStays"
                        oSelZone.LVFlyingStays.Add(oElem.ID, oElem);
                        break;

                    case "016":
                        //LVShortStays
                        oSelZone.LVShortStays.Add(oElem.ID, oElem);
                        break;

                    case "017":
                        //MVFlyingStays"
                        oSelZone.MVFlyingStays.Add(oElem.ID, oElem);
                        break;

                    case "018":
                        //MVShortStays
                        oSelZone.MVShortStays.Add(oElem.ID, oElem);
                        break;

                    case "035":
                        //MVFuseIsolators
                        oSelZone.MVFuseIsolators.Add(oElem.ID, oElem);
                        break;

                    case "TXTCS":
                        //TRFRs
                        oSelZone.TRFRs.Add(oElem.ID, oElem);
                        break;

                    default:
                        oSelZone.elseCellElements.Add(oElem.ID, oElem);
                        break;
                    }
                    break;

                case BCOM.MsdElementType.Line:

                    switch (oElem.Level.Name)
                    {
                    case "Level 18":
                        // Airdac
                        oSelZone.Airdac.Add(oElem.ID, oElem);
                        break;

                    //Debug.Print CStr(oEnum.Current.ID.high) & CStr(oEnum.Current.ID.low)
                    case "Level 25":
                        //LVConductor
                        oSelZone.LVConductor.Add(oElem.ID, oElem);
                        break;

                    case "Level 29":
                        //MVConductor
                        oSelZone.MVConductor.Add(oElem.ID, oElem);
                        break;

                    default:
                        oSelZone.elseLineElements.Add(oElem.ID, oElem);
                        break;
                    }
                    break;

                case BCOM.MsdElementType.Shape:

                    switch (oElem.Level.Name)
                    {
                    case "Level 11":
                        //TrfrShapes
                        oSelZone.TrfrShapes.Add(oElem.ID, oElem);
                        break;

                    default:
                        oSelZone.elseShapeElements.Add(oElem.ID, oElem);
                        break;
                    }
                    break;

                case (BCOM.MsdElementType.Text):

                    switch (oElem.Level.Name)
                    {
                    case "Level 3":
                        //houseText
                        oSelZone.houseText.Add(oElem.ID, oElem);
                        break;

                    default:
                        oSelZone.elseTextElements.Add(oElem.ID, oElem);
                        break;
                    }
                    break;

                default:
                    oSelZone.elseElements.Add(oElem.ID, oElem);
                    break;
                }
            }

            Debug.Print(oSelZone.ToString());
            Debug.Print(oSelZone.mergedMVPolesList().Count.ToString());

            Debug.Print(oSelZone.printCoordinatesMVPoles());
            Debug.Print(oSelZone.printCoordinatesMVLines());
        }