AnsweredAssumed Answered

Grow/Shrink Rectangle

Question asked by on Oct 5, 2016
Latest reply on Oct 6, 2016 by

Trying to write a method that will grow/shrink an object, however there is nothing in the shapes collection.  I have added the correct pSafeArrayOfPoints and I can see the array populate, Im not sure why shapes is empty.  Here is my code in C#.  Curious if anyone has done something similar or could help point me where I may be doing something wrong.


public Array GrowShrink(Array newPntArray, string growShrinkValue)


            Array pointsArray = null;          

            double resizeAmt = double.Parse(growShrinkValue);

            int length = newPntArray.GetLength(1);



            var maskEngine = Com.Dispatch<MaskEngine>("MGCPCBEngines.MaskEngine");                                  

            Mask mask = maskEngine.Masks.Add();                       

            object pSafeArrayOfPoints = (object) newPntArray;

            mask.Shapes.AddByPointsArray(length, ref pSafeArrayOfPoints);          

            mask.Oversize(resizeAmt, EMaskEngineOversizeType.emeOversizeTypeSquare);

            Shapes shapes = mask.Shapes;                                



                foreach (Shape item in shapes)


                    pointsArray = item.PointsArray;



          return pointsArray;