3 Replies Latest reply on May 3, 2011 11:50 PM by mirko.stortini

    Create a Circle Shape by Automation

    mirko.stortini

      Hi to all,

      How I can create a circle shape with automation ?

      I use PutUserLayerGfx to create polylines, but I no found a method for circle shape.

       

      Any ideas ?? 

       

      Thanks

       

      Mirko

        • 1. Re: Create a Circle Shape by Automation
          john_dube

          Hi Mirko,

           

          Use the Application.Utility.CreateCircleXYR method to create a points array with the circle, then pass that points array into PutUserLayerGfx.

           

          John

          • 2. Re: Create a Circle Shape by Automation
            mirko.stortini

            Hi John,

            many thanks for your answer

            I have already tried the CreateCircleXYR function but VB give me an error 91 (Object variable or With block variable not set)

            I think that I forgot something......this is the code :

             

                Dim cX As Double

                Dim cY As Double

                Dim cR As Double

                Dim pntsArr

                Dim cirObj As Utility

             

                cX = 10#: cY = 10#: cR = 2#

                pntsArr = cirObj.CreateCircleXYR(cX, cY, cR)               <------ Error Here  !!

             

                '...insert Graphics

             

             

             

            Mirko

            • 3. Re: Create a Circle Shape by Automation
              mirko.stortini

              oops....I have forgot to set the variable !! 

               

              This Work :

               

                  Dim cX As Double

                  Dim cY As Double

                  Dim cR As Double

                  cX = 10#: cY = 10#: cR = 2#

                  Dim cirObj As Utility

               

                  Set cirObj = appPCB.Utility

                  pntsArr = cirObj.CreateCircleXYR(cX, cY, cR)

               

                  '...insert Graphics

                  Set LayerObj = doc.UserLayers.Item(ComboLayerForMok.Text)

                  Set gfxObj = doc.PutUserLayerGfx(LayerObj, lineWidth, numPoints, pntsArr, False, Nothing, epcbUnitCurrent)

               

               

              Mirko