0 Replies Latest reply on Oct 4, 2018 7:48 AM by Anand Bhave

    We are plotting bounding boxes for dimensions but eventually it is working for some random dimensions.

    Anand Bhave

      1)Working on following drawing  attached by name "Ladder",

      WorkingOriginalDrawingWithBoundingBox.PNG

      2)Not working on following attached by name "SlabWithPocket",

      NotWorkingOriginalDrawingWithBoundingBox.PNG

      Code for plotting bounding boxes for dimentions as follows,

      Double[]   displaydmpoint = swView.GetDimensionDisplayInfo5();

      Object[] DimentionAnnotations = (Object[])swView.GetDisplayDimensions();

                          for (int j = 0, i = 0; j <= DimentionAnnotations.GetUpperBound(0) && i < displaydmpoint.Length; i = i + 95, j++)

                          {

       

       

                              swDisplayDimension = (DisplayDimension)DimentionAnnotations[j];

                              ITextFormat textFormat = (TextFormat)swDisplayDimension.GetTextFormat();

       

       

                              double dimensionTextHeightValue = swDisplayDimension.IGetDisplayData().GetTextHeightAtIndex(j);

       

       

                              double dimensionTextWidthValue = swDisplayDimension.IGetDisplayData().GetTextInBoxWidthAtIndex(j);

       

       

                            

                          

                              swCurruntAnnotation = swDisplayDimension.GetAnnotation();

       

       

                            //  double[] startPoint = displaydmpoint.

                              // Center points for dimension

                              double[] dimentionMidPoint = swCurruntAnnotation.GetPosition();

                              x = dimentionMidPoint[0];

                              y = dimentionMidPoint[1];

                              z = dimentionMidPoint[2];

                              //Left Corner of dimention

                              double[] dimentionPosition = swDisplayDimension.IGetDisplayData().GetTextPositionAtIndex(j);

                              c1 = dimentionPosition[0];

                              c2 = dimentionPosition[1];

                              c3 = dimentionPosition[2];

       

       

                              //Plot Bounding Box for dimention

                              swSketchMgr.CreateCenterRectangle(x/swSheetProp[2], y /swSheetProp[2], z/swSheetProp[2], c1/swSheetProp[2], c2/swSheetProp[2], c3/swSheetProp[2]);

                           

       

       

                          }