Exemplo n.º 1
0
        public void Render(IVisio.Page page)
        {

            var dic = GetDayOfWeekDic();

            // calcualte actual days in month
            int weekday = 0 + dic[this.MonthYear.FirstDay.DayOfWeek];
            int week = 0;
          
            foreach (int day in Enumerable.Range(0,this.MonthYear.DaysInMonth))
            {
                double x = 0.0 + weekday*1.0;
                double y = 6.0 - week*1.0;
                var shape = page.DrawRectangle(x, y, x + 0.9, y + 0.9);

                weekday++;
                if (weekday >= 7)
                {
                    week++;
                    weekday = 0;
                }

                shape.Text = string.Format("{0}", new System.DateTime(this.MonthYear.Year, this.MonthYear.Month, day+1));
            }
        }
 public static void DrawNode(
     BoxL.Node node,
     VA.Drawing.Rectangle rect, IVisio.Page page)
 {           
     var shape = page.DrawRectangle(rect);
     node.Data = shape;
 }
Exemplo n.º 3
0
 public static IVisio.Shape CreateStandardShape(IVisio.Page page)
 {
     var shape = page.DrawRectangle(1, 1, 4, 3);
     var cell_width = shape.CellsU["Width"];
     var cell_height = shape.CellsU["Height"];
     cell_width.Formula = "=(1.0+2.5)";
     cell_height.Formula = "=(0.0+1.5)";
     return shape;
 }
Exemplo n.º 4
0
        /// <summary>
        /// Draw an "Entity" Rectangle
        /// </summary>
        /// <param name="page">The Page on which to draw</param>
        /// <param name="entityName">The name of the entity</param>
        /// <param name="ownership">The ownership type of the entity</param>
        /// <returns>The newly drawn rectangle</returns>
        private VisioApi.Shape DrawEntityRectangle(VisioApi.Page page, string entityName, OwnershipTypes ownership)
        {
            VisioApi.Shape rect = page.DrawRectangle(X_POS1, Y_POS1, X_POS2, Y_POS2);
            rect.Name = entityName;
            rect.Text = entityName + " ";

            // Determine the shape fill color based on entity ownership.
            string fillColor;

            // Update the style of the entity name
            VisioApi.Characters characters = rect.Characters;
            characters.Begin = 0;
            characters.End = entityName.Length;
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterStyle, (short)VisioApi.VisCellVals.visBold);
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterSize, NAME_CHARACTER_SIZE);
            //set the font family of the text to segoe for the visio 2013.
            if (VersionName == "15.0")
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterFont, (short)FONT_STYLE); 
          
            switch (ownership)
            {
                case OwnershipTypes.BusinessOwned:                   
                    fillColor = "RGB(255,140,0)"; // orange
                    characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterColor, (short)VisioApi.VisDefaultColors.visBlack);// set the font color of the text
                    break;
                case OwnershipTypes.OrganizationOwned:                    
                    fillColor = "RGB(127, 186, 0)"; // green
                    characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterColor, (short)VisioApi.VisDefaultColors.visBlack);// set the font color of the text
                    break;
                case OwnershipTypes.UserOwned:                    
                    fillColor = "RGB(0,24,143)"; // blue 
                    characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterColor, (short)VisioApi.VisDefaultColors.visWhite);// set the font color of the text
                    break;
                default:
                    fillColor = "RGB(255,255,255)"; // White
                    characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterColor, (short)VisioApi.VisDefaultColors.visDarkBlue);// set the font color of the text
                    break;
            }

            // Set the fill color, placement properties, and line weight of the shape.
            rect.get_CellsSRC(VISIO_SECTION_OJBECT_INDEX, (short)VisioApi.VisRowIndices.visRowMisc, (short)VisioApi.VisCellIndices.visLOFlags).FormulaU = ((int)VisioApi.VisCellVals.visLOFlagsPlacable).ToString();
            rect.get_CellsSRC(VISIO_SECTION_OJBECT_INDEX, (short)VisioApi.VisRowIndices.visRowFill, (short)VisioApi.VisCellIndices.visFillForegnd).FormulaU = fillColor;            
            return rect;
        }
Exemplo n.º 5
0
        /// <summary>
        /// Draw an "Entity" Rectangle
        /// </summary>
        /// <param name="page">The Page on which to draw</param>
        /// <param name="entityName">The name of the entity</param>
        /// <param name="ownership">The ownership type of the entity</param>
        /// <returns>The newly drawn rectangle</returns>
        private VisioApi.Shape DrawEntityRectangle(VisioApi.Page page, string entityName, OwnershipTypes ownership)
        {
            VisioApi.Shape rect = page.DrawRectangle(X_POS1, Y_POS1, X_POS2, Y_POS2);
            rect.Name = entityName;
            rect.Text = entityName + " ";

            //// Determine the shape fill color based on entity ownership.
            //string fillColor;

            //switch (ownership)
            //{
            //    case OwnershipTypes.BusinessOwned:
            //        fillColor = "RGB(255,202,176)"; // Light orange
            //        break;
            //    case OwnershipTypes.OrganizationOwned:
            //        fillColor = "RGB(255,255,176)"; // Light yellow
            //        break;
            //    case OwnershipTypes.UserOwned:
            //        fillColor = "RGB(204,255,204)"; // Light green
            //        break;
            //    default:
            //        fillColor = "RGB(255,255,255)"; // White
            //        break;
            //}

            // Set the fill color, placement properties, and line weight of the shape.
            rect.get_CellsSRC(VISIO_SECTION_OJBECT_INDEX, (short)VisioApi.VisRowIndices.visRowMisc, (short)VisioApi.VisCellIndices.visLOFlags).Formula = ((int)VisioApi.VisCellVals.visLOFlagsPlacable).ToString();
            //rect.get_CellsSRC(VISIO_SECTION_OJBECT_INDEX, (short)VisioApi.VisRowIndices.visRowFill, (short)VisioApi.VisCellIndices.visFillForegnd).Formula = fillColor;
            // Update the style of the entity name
            VisioApi.Characters characters = rect.Characters;
            characters.Begin = 0;
            characters.End = entityName.Length;
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterStyle, (short)VisioApi.VisCellVals.visBold);
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterColor, (short)VisioApi.VisDefaultColors.visDarkBlue);
            characters.set_CharProps((short)VisioApi.VisCellIndices.visCharacterSize, NAME_CHARACTER_SIZE);

            return rect;
        }
 private IVisio.Shape[] draw_standard_shapes(IVisio.Page page1)
 {
     var s1 = page1.DrawRectangle(0, 0, 1, 1);
     var s2 = page1.DrawRectangle(0, 3, 1, 4);
     var s3 = page1.DrawRectangle(3, 0, 4, 1);
     s1.Text = "A";
     s2.Text = "B";
     s3.Text = "C";
     return new[] { s1, s2, s3 };
 }
        public void Render(IVisio.Page page)
        {
            this.TotalMarginWidth = this.Rectangle.Width*(0.10);
            this.TotalBarSpacingWidth = this.Rectangle.Width * (0.10);
            this.TotalBarWidth = this.Rectangle.Width*(0.80);

            int num_points = this.DataPoints.Count;

            double bar_spacing = num_points > 1 ? this.TotalBarSpacingWidth/num_points : 0.0;
            double bar_width = num_points > 0 ? this.TotalBarWidth/num_points : this.TotalBarWidth;

            double cur_x = this.Rectangle.Left + (this.TotalMarginWidth/2.0);

            double max = this.DataPoints.Select(i => i.Value).Max();
            double min = this.DataPoints.Select(i => i.Value).Min();
            var range = ChartUtil.GetValueRangeDistance(min, max);

            double base_y = this.Rectangle.Bottom;

            if (min < 0.0)
            {
                base_y += System.Math.Abs(this.Rectangle.Height * (min / range));
            }

            var category_axis_start_point = new Drawing.Point(this.Rectangle.Left, base_y);
            var category_axis_end_point = new Drawing.Point(this.Rectangle.Right, base_y);
            var category_axis_shape = page.DrawLine(category_axis_start_point, category_axis_end_point);

            foreach (var p in this.DataPoints)
            {
                var value_height = System.Math.Abs(this.Rectangle.Height*(p.Value/range));

                Drawing.Point bar_p0;
                Drawing.Point bar_p1;

                if (p.Value >= 0.0)
                {
                    bar_p0 = new Drawing.Point(cur_x, base_y);
                    bar_p1 = new Drawing.Point(cur_x + bar_width, base_y + value_height);
                }
                else
                {
                    bar_p0 = new Drawing.Point(cur_x, base_y - value_height);
                    bar_p1 = new Drawing.Point(cur_x + bar_width, base_y);                    
                }
                
                var bar_rect = new Drawing.Rectangle(bar_p0, bar_p1);
                var shape = page.DrawRectangle(bar_rect);
                p.VisioShape = shape;

                if (p.Label != null)
                {
                    shape.Text = p.Label;
                }

                cur_x += bar_width + bar_spacing;
            }

            var allshapes = this.DataPoints.Select(dp => dp.VisioShape).Where(s => s != null).ToList();
            allshapes.Add(category_axis_shape);

            ChartUtil.GroupShapesIfNeeded(page, allshapes);

        }
        private static Visio.Shape DrawRectangle(Visio.Page page, string name, int titleLength, string text, string fillColor)
        {
            Visio.Shape rect = page.DrawRectangle(X_POS1, Y_POS1, X_POS2, Y_POS2);
            rect.Name = name.ToUpperInvariant();
            rect.Text = text;

            // Set the fill color, placement properties, and line weight of the shape.
            rect.get_CellsU("ObjType").FormulaU = ((int)Visio.VisCellVals.visLOFlagsPlacable).ToString();
            rect.get_CellsU("FillForegnd").FormulaU = fillColor;
            rect.get_CellsU("Width").FormulaU = "TEXTWIDTH(TheText,100mm)";
            rect.get_CellsU("Height").FormulaU = "TEXTHEIGHT(TheText,100mm)";

            // Update the style of the entity name
            Visio.Characters characters = rect.Characters;
            characters.set_CharProps((short)Visio.VisCellIndices.visCharacterSize, NAME_CHARACTER_SIZE);
            characters.set_ParaProps((short)Visio.VisCellIndices.visHorzAlign, (short)Visio.VisCellVals.visHorzLeft);

            Visio.Characters titleChars = rect.Characters;
            titleChars.End = titleLength;
            titleChars.set_CharProps((short)Visio.VisCellIndices.visCharacterStyle, (short)Visio.VisCellVals.visBold);
            titleChars.set_CharProps((short)Visio.VisCellIndices.visCharacterColor, (short)Visio.VisDefaultColors.visDarkBlue);
            titleChars.set_ParaProps((short)Visio.VisCellIndices.visHorzAlign, (short)Visio.VisCellVals.visHorzCenter);

            return rect;
        }
        /// <summary>
        /// This method is drawing header of core connections table
        /// </summary>
        /// <param name="aPage">page to drawn on</param>
        /// <param name="aStartPosY">position in vertical in which table header should start</param>
        /// <returns>vertical position after drawing</returns>
        private double DrawTableHeader( Visio.Page aPage, double aStartPosY )
        {
            double _currentX = mMargin;
            double _nextX = mMargin + mEquiWidth;

            Visio.Shape _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Equipment Name", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mElconnWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Conn", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mCoreWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Terminator", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mSpaceBetween;

            aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );

            _currentX = _nextX;
            _nextX = _currentX + mCoreWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Core", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mSpaceBetween;

            aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );

            _currentX = _nextX;
            _nextX = _currentX + mCableWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth / 2.0 );
            SetTextProperties( _newShape, "Cable Name", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY - mTableHeaderCellWidth / 2.0, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Cable Component", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mSpaceBetween;

            aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );

            _currentX = _nextX;
            _nextX = _currentX + mCoreWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Core", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mSpaceBetween;

            aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );

            _currentX = _nextX;
            _nextX = _currentX + mCoreWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Terminator", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mElconnWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Conn", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _currentX = _nextX;
            _nextX = _currentX + mEquiWidth;

            _newShape = aPage.DrawRectangle( _currentX, aStartPosY, _nextX, aStartPosY - mTableHeaderCellWidth );
            SetTextProperties( _newShape, "Equipment Name", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            return ( aStartPosY - mTableHeaderCellWidth );
        }
        /// <summary>
        /// This method is drawing core connections diagram header
        /// </summary>
        /// <param name="aPage">page on which header should be placed</param>
        /// <returns>vertical position after drawing</returns>
        private double DrawDiagramHeader( Visio.Page aPage )
        {
            Visio.Shape _newShape = aPage.DrawRectangle( mInitialPosX, mInitialPosY, mInitialPosX + mSingleWidth * 3, mInitialPosY - mSingleHeight );
            SetTextProperties( _newShape, "TITLE", FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 3, mInitialPosY, mInitialPosX + mSingleWidth * 4, mInitialPosY - mSingleHeight );
            SetTextProperties( _newShape, "DRWN BY/DATE", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 4, mInitialPosY, mInitialPosX + mSingleWidth * 5, mInitialPosY - mSingleHeight );
            SetTextProperties( _newShape, string.Empty, FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 5, mInitialPosY, mInitialPosX + mSingleWidth * 7 + mMargin, mInitialPosY - mSingleHeight );
            SetTextProperties( _newShape, "SHEET OF", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX, mInitialPosY - mSingleHeight, mInitialPosX + mSingleWidth * 3, mInitialPosY - mSingleHeight * 3 );
            SetTextProperties( _newShape, string.Empty, FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 3, mInitialPosY - mSingleHeight, mInitialPosX + mSingleWidth * 4, mInitialPosY - mSingleHeight * 2 );
            SetTextProperties( _newShape, "CHKD BY/DATE", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 4, mInitialPosY - mSingleHeight, mInitialPosX + mSingleWidth * 5, mInitialPosY - mSingleHeight * 2 );
            SetTextProperties( _newShape, string.Empty, FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 5, mInitialPosY - mSingleHeight, mInitialPosX + mSingleWidth * 7 + mMargin, mInitialPosY - mSingleHeight * 2 );
            SetTextProperties( _newShape, "SHIP NO:", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 3, mInitialPosY - mSingleHeight * 2, mInitialPosX + mSingleWidth * 4, mInitialPosY - mSingleHeight * 3 );
            SetTextProperties( _newShape, "APPR BY/DATE", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 4, mInitialPosY - mSingleHeight * 2, mInitialPosX + mSingleWidth * 5, mInitialPosY - mSingleHeight * 3 );
            SetTextProperties( _newShape, string.Empty, FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 5, mInitialPosY - mSingleHeight * 2, mInitialPosX + mSingleWidth * 6 + mMargin / 2.0, mInitialPosY - mSingleHeight * 3 );
            SetTextProperties( _newShape, "DRG NO:", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            _newShape = aPage.DrawRectangle( mInitialPosX + mSingleWidth * 6 + mMargin / 2.0, mInitialPosY - mSingleHeight * 2, mInitialPosX + mSingleWidth * 7 + mMargin, mInitialPosY - mSingleHeight * 3 );
            SetTextProperties( _newShape, "REV NO:", FONT_SIZE, (int)Visio.VisCellVals.visHorzLeft );

            return ( mInitialPosY - mSingleHeight * 3 );
        }
        /// <summary>
        /// This method is drawing schema for single cable
        /// </summary>
        /// <param name="aPage">page to draw on</param>
        /// <param name="aCableInfo">information about cable to draw</param>
        /// <param name="aPosY">vertical position in which schema should start</param>
        /// <returns>ertical position after drawing</returns>
        private double DrawCable( Visio.Page aPage, CableInfo aCableInfo, double aPosY )
        {
            if( aCableInfo.CoreNo == 0 )
                aCableInfo.CoreInfo.Add( new CoreInfo( Database.DbElement.GetElement(), aCableInfo ) );

            double _cableHeight = aCableInfo.CoreNo * mCoreHeight;

            Visio.Shape _newShape = aPage.DrawLine( mCablePosX, aPosY - _cableHeight / 2.0, mCablePosX + mCableWidth, aPosY - _cableHeight / 2.0 );
            SetTextProperties( _newShape, aCableInfo.CableName + Environment.NewLine + aCableInfo.ComponentName, FONT_SIZE, (int)Visio.VisCellVals.visHorzCenter );

            _newShape = aPage.DrawLine( mCablePosX, aPosY, mCablePosX, aPosY - _cableHeight );
            _newShape = aPage.DrawLine( mCablePosX + mCableWidth, aPosY, mCablePosX + mCableWidth, aPosY - _cableHeight );

            int _lastBeginEqui = 0, _lastEndEqui = 0, _lastBeginElconn = 0, _lastEndElconn = 0, _current = 0;
            string _lastBeginEquiName = string.Empty, _lastEndEquiName = string.Empty, _lastBeginElconnName = string.Empty, _lastEndElconnName = string.Empty;

            foreach( CoreInfo _core in aCableInfo.CoreInfo )
            {
                //draw core boxes
                _newShape = aPage.DrawRectangle( mCablePosX - mCoreWidth - mSpaceBetween, aPosY - _current * mCoreHeight, mCablePosX - mSpaceBetween, aPosY - ( _current + 1 ) * mCoreHeight );
                SetTextProperties( _newShape, _core.CoreName, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                _newShape = aPage.DrawRectangle( mCablePosX + mCableWidth + mSpaceBetween, aPosY - _current * mCoreHeight, mCablePosX + mCableWidth + mSpaceBetween + mCoreWidth, aPosY - ( _current + 1 ) * mCoreHeight );
                SetTextProperties( _newShape, _core.CoreName, "6pt", (int)Visio.VisCellVals.visHorzCenter );

                //draw pin boxes
                _newShape = aPage.DrawRectangle( mCablePosX - ( mCoreWidth + mSpaceBetween ) * 2, aPosY - _current * mCoreHeight, mCablePosX - mCoreWidth - mSpaceBetween * 2, aPosY - ( _current + 1 ) * mCoreHeight );
                SetTextProperties( _newShape, _core.StartPin, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                _newShape = aPage.DrawRectangle( mCablePosX + mCableWidth + mSpaceBetween * 2 + mCoreWidth, aPosY - _current * mCoreHeight, mCablePosX + mCableWidth + ( mSpaceBetween + mCoreWidth ) * 2, aPosY - ( _current + 1 ) * mCoreHeight );
                SetTextProperties( _newShape, _core.EndPin, "6pt", (int)Visio.VisCellVals.visHorzCenter );

                //check/draw elconns
                if( _core.StartElconn == string.Empty || _lastBeginElconnName != _core.StartElconn )
                {
                    if( _current > 0 )
                    {
                        double _posX = mCablePosX - ( mSpaceBetween + mCoreWidth ) * 2;
                        double _posY = aPosY - _lastBeginElconn * mCoreHeight;
                        //draw elconn
                        _newShape = aPage.DrawRectangle( _posX - mElconnWidth, _posY, _posX, _posY - ( _current - _lastBeginElconn ) * mCoreHeight );
                        SetTextProperties( _newShape, _lastBeginElconnName, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                        _lastBeginElconn = _current;
                    }
                    _lastBeginElconnName = _core.StartElconn;
                }
                if( _core.EndElconn == string.Empty || _lastEndElconnName != _core.EndElconn )
                {
                    if( _current > 0 )
                    {
                        //draw elconn
                        double _posX = mCablePosX + ( mSpaceBetween + mCoreWidth ) * 2 + mCableWidth;
                        double _posY = aPosY - _lastEndElconn * mCoreHeight;
                        //draw elconn
                        _newShape = aPage.DrawRectangle( _posX, _posY, _posX + mElconnWidth, _posY - ( _current - _lastEndElconn ) * mCoreHeight );
                        SetTextProperties( _newShape, _lastEndElconnName, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                        _lastEndElconn = _current;
                    }
                    _lastEndElconnName = _core.EndElconn;
                }

                //check/draw equips
                if( _core.StartEqui == string.Empty || _lastBeginEquiName != _core.StartEqui )
                {
                    if( _current > 0 )
                    {
                        //draw equi
                        double _posX = mCablePosX - ( mSpaceBetween + mCoreWidth ) * 2 - mElconnWidth;
                        double _posY = aPosY - _lastBeginEqui * mCoreHeight;

                        _newShape = aPage.DrawRectangle( _posX - mEquiWidth, _posY, _posX, _posY - ( _current - _lastBeginEqui ) * mCoreHeight );
                        SetTextProperties( _newShape, _lastBeginEquiName, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                        _lastBeginEqui = _current;
                    }
                    _lastBeginEquiName = _core.StartEqui;
                }
                if( _core.EndEqui == string.Empty || _lastEndEquiName != _core.EndEqui )
                {
                    if( _current > 0 )
                    {
                        //draw equi
                        double _posX = mCablePosX + ( mSpaceBetween + mCoreWidth ) * 2 + mCableWidth + mElconnWidth;
                        double _posY = aPosY - _lastEndEqui * mCoreHeight;

                        _newShape = aPage.DrawRectangle( _posX, _posY, _posX + mEquiWidth, _posY - ( _current - _lastEndEqui ) * mCoreHeight );
                        SetTextProperties( _newShape, _lastEndEquiName, "6pt", (int)Visio.VisCellVals.visHorzCenter );
                        _lastEndEqui = _current;
                    }
                    _lastEndEquiName = _core.EndEqui;
                }
                _current++;
            }
            //draw last elconns
            double _pX = mCablePosX - ( mSpaceBetween + mCoreWidth ) * 2;
            double _pY = aPosY - _lastBeginElconn * mCoreHeight;

            _newShape = aPage.DrawRectangle( _pX - mElconnWidth, _pY, _pX, _pY - ( _current - _lastBeginElconn ) * mCoreHeight );
            SetTextProperties( _newShape, _lastBeginElconnName, "6pt", (int)Visio.VisCellVals.visHorzCenter );

            _pX = mCablePosX + ( mSpaceBetween + mCoreWidth ) * 2 + mCableWidth;
            _pY = aPosY - _lastEndElconn * mCoreHeight;

            _newShape = aPage.DrawRectangle( _pX, _pY, _pX + mElconnWidth, _pY - ( _current - _lastEndElconn ) * mCoreHeight );
            SetTextProperties( _newShape, _lastEndElconnName, "6pt", (int)Visio.VisCellVals.visHorzCenter );

            //draw last equips
            _pX = mCablePosX - ( mSpaceBetween + mCoreWidth ) * 2 - mElconnWidth;
            _pY = aPosY - _lastBeginEqui * mCoreHeight;

            _newShape = aPage.DrawRectangle( _pX - mEquiWidth, _pY, _pX, _pY - ( _current - _lastBeginEqui ) * mCoreHeight );
            SetTextProperties( _newShape, _lastBeginEquiName, "6pt", (int)Visio.VisCellVals.visHorzCenter );

            _pX = mCablePosX + ( mSpaceBetween + mCoreWidth ) * 2 + mCableWidth + mElconnWidth;
            _pY = aPosY - _lastEndEqui * mCoreHeight;

            _newShape = aPage.DrawRectangle( _pX, _pY, _pX + mEquiWidth, _pY - ( _current - _lastEndEqui ) * mCoreHeight );
            SetTextProperties( _newShape, _lastEndEquiName, "6pt", (int)Visio.VisCellVals.visHorzCenter );

            return ( aPosY - _cableHeight );
        }