コード例 #1
0
        public void Generate()
        {
            KD.SDK.SceneEnum.ViewMode currentViewMode = _buildCommon.GetView();

            Articles articles = this.CurrentAppli.GetArticleList(FilterArticle.FilterToGetWallByValid());

            if (articles != null && articles.Count > 0)
            {
                Walls walls = new Walls(articles);

                foreach (Wall wall in walls)
                {
                    Articles articlesAgainst = wall.AgainstMeASC;

                    if (articlesAgainst != null && articlesAgainst.Count > 0)
                    {
                        wall.IsActive = true;
                        _buildCommon.SetView(KD.SDK.SceneEnum.ViewMode.VECTELEVATION);
                        _buildCommon.ZoomAdjusted();
                        _buildCommon.ExportImageJPG(walls.IndexOf(wall) + 1, OrderTransmission.ElevName);
                    }
                }
                _buildCommon.SetView(currentViewMode);
            }
        }
コード例 #2
0
        private string GetVisibleSide(Article article) //How to set in catalog and explain top and bottom ?
        {
            string visibleSide = String.Empty;

            string   filter = FilterArticle.strFilterToGetArticleByCodeValidPlaced(article.CatalogCode);
            Articles childs = article.GetChildren(filter);

            foreach (Article child in childs)
            {
                if (child.BlockCode == "CPG")
                {
                    visibleSide += "L";
                }
                if (child.BlockCode == "CPD")
                {
                    visibleSide += "R";
                }
                if (child.BlockCode == "CPT")
                {
                    visibleSide += "O";
                }
                if (child.BlockCode == "CPB")
                {
                    visibleSide += "U";
                }
                if (child.BlockCode == "CPR")
                {
                    visibleSide += "H";
                }
            }
            return(visibleSide);
        }
コード例 #3
0
        private Article PlaceComponentObject()
        {
            if (this.RefPos.Contains(KD.StringTools.Const.Dot))
            {
                string refBase = this.RefPos.Split(KD.CharTools.Const.Dot)[0];

                foreach (KeyValuePair <int, string> kvp in ImportObject.articlePlacedDict)
                {
                    if (kvp.Value.Contains(KD.StringTools.Const.Dot))
                    {
                        string kvpBase = kvp.Value.Split(KD.CharTools.Const.Dot)[0];
                        if (kvpBase.Equals(refBase))
                        {
                            Article  parent = new Article(_plugin.CurrentAppli, kvp.Key);
                            Articles childs = parent.GetChildren(FilterArticle.strFilterToGetValidHostedAndChildren());//FilterArticle.strFilterToGetValidNotPlacedHostedAndChildren
                            foreach (Article child in childs)
                            {
                                //The 20/01/2021 i change the reference to place the article with CommentName instead of Name cause the article with underscore doesnt work
                                if (child.IsValid && child.KeyRef.Equals(this.CommentName))
                                {
                                    bool find = false;  //Test with Bauformat Side panel maybe don't work for another
                                    if (this.RefPntX == 0.0 && child.Handing == _plugin.CurrentAppli.GetTranslatedText("G"))
                                    {
                                        find = true;
                                    }
                                    else if (this.RefPntX > 0.0 && child.Handing == _plugin.CurrentAppli.GetTranslatedText("D"))
                                    {
                                        find = true;
                                    }
                                    else
                                    {
                                        find = true;
                                    }

                                    if (find)
                                    {
                                        child.IsPlaced = true;
                                        //child.DimensionX = w1;
                                        //child.DimensionY = d1;
                                        child.DimensionZ = this.Measure_H;
                                        //child.PositionX = x1;
                                        //child.PositionY = y1;
                                        child.PositionZ = this.RefPntZ;
                                        return(child);
                                    }
                                }
                            }
                        }
                    }
                }
            }
            return(null);
        }
コード例 #4
0
        private void ChangeFilerChildDimensions()
        {
            Articles childs = this.Article.GetChildren(FilterArticle.strFilterToGetValidPlacedHostedAndChildren());

            if (childs != null && childs.Count > 0)
            {
                foreach (Article child in childs)
                {
                    if (child.Name.ToUpper().Contains(_plugin.CurrentAppli.GetTranslatedText(CatalogBlockName.Filer.ToUpper())))
                    {
                        child.DimensionX = (this.Measure_B - this.Measure_B1);
                        child.DimensionY = (this.Measure_T - this.Measure_T1);
                    }
                }
            }
        }
コード例 #5
0
        public string[] GetArticlePolyPoint(Article article)
        {
            SegmentClassification segmentClassification = new SegmentClassification(article);
            string shapePointList    = String.Empty;
            string newShapePointList = string.Empty;

            this.SetSceneReference(OrderWrite.version);
            shapePointList = segmentClassification.GetShape();

            if (String.IsNullOrEmpty(shapePointList))
            {
                if (segmentClassification.IsArticlePlinth())
                {
                    if (article.HasParent())
                    {
                        SegmentClassification segmentParentClassification = new SegmentClassification(article.Parent);
                        if (segmentParentClassification.IsArticlePlinth())
                        {
                            shapePointList = segmentParentClassification.GetShape();
                        }
                    }
                    else
                    {
                        Articles childs = article.GetChildren(FilterArticle.strFilterToGetValidPlacedHostedAndChildren());
                        if (childs.Count > 0)
                        {
                            foreach (Article child in childs)
                            {
                                SegmentClassification segmentChildClassification = new SegmentClassification(child);
                                if (segmentChildClassification.IsArticlePlinth())
                                {
                                    shapePointList = segmentChildClassification.GetShape();
                                }
                            }
                        }
                    }
                }
            }

            if (!String.IsNullOrEmpty(shapePointList))
            {
                string[] points = shapePointList.Split(KD.CharTools.Const.SemiColon); // 5 pts
                foreach (string point in points)
                {
                    string[] coords = point.Split(KD.CharTools.Const.Comma);
                    if (coords.Length > 3)
                    {
                        newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[0]) - _sceneDimX) + KD.CharTools.Const.Comma;
                        newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[1]) - _sceneDimY) + KD.CharTools.Const.Comma;
                        newShapePointList += Convert.ToString(KD.StringTools.Convert.ToDouble(coords[2]) - _sceneDimZ) + KD.CharTools.Const.Comma;
                        newShapePointList += coords[3] + KD.CharTools.Const.SemiColon;
                    }
                }


                string[] shapeList = newShapePointList.Split(KD.CharTools.Const.SemiColon);
                if (shapeList.Length > 0)
                {
                    //Determine the position for linear because in Insitu is 0,0 and we need the first shape point.
                    if (segmentClassification.IsArticleLinear() || segmentClassification.IsArticleWorkTop())
                    {
                        OrderWrite.posX = KD.StringTools.Convert.ToDouble(shapeList[0].Split(KD.CharTools.Const.Comma)[0]);
                        OrderWrite.posY = KD.StringTools.Convert.ToDouble(shapeList[0].Split(KD.CharTools.Const.Comma)[1]);
                    }

                    return(shapeList);
                }
            }
            return(null);
        }