3 Replies Latest reply on Oct 22, 2014 3:19 PM by ron_tinnell

    Ample code to create a circle

    nate.nicholson

      Greetings,

      I want to add a circle in my layout using Ample code. I
      was hoping to find an Ample command like “add_ellipse()” or “add_circle()”.

      If I add a circle manually and monitor the activity in the
      Transcript Section, it uses “add_shape()” with a huge list of coordinates. I
      know where I want the center of the circle and the circles radius – in my Ample
      code, how do I get this huge list of coordinates?

      Thanks,

      -Nate.

        • 1. Re: Ample code to create a circle
          Catherine

          Hi,

           

          Could you please tell me which application you are trying to do this?

          Thanks,

          Catherine

          • 2. Re: Ample code to create a circle
            nate.nicholson

            Hi Catherine,

             

            Thanks for they reply. I am using IC Graph.

             

            I did stumble across an answer to my own question while researching a different problem.

            “$add_circle()” does not exist, but “$get_circle()” does. So knowing the circle origin and radius, I can use “$get_circle()” to create the huge list  of ic_locations. “$add_shape()” can use this vector to draw the circle.

             

            Thanks again for the reply,

             

            -Nate.

            • 3. Re: Ample code to create a circle
              ron_tinnell

              Hi Nate,

               

              We do not have this exact command. There is a command you can use to get what you need. The correct command for doing this is $add_donut and it takes the following arguments.

               

                type : name [circle, rectangle] { default = $last },

                layer : string { default = $last },

                pt1 : ic_location, //center point

                pt2 : ic_location, // inside radius point

                pt3 : ic_location  // outside radius point

               

              Try the function interactively to see how it works. If you specify the same point for pt1 and pt2, then you would get a circle. Remember, these are not perfect circles due to the limits of the grid. These are made from a series of lines to closely approximate a circle.

              Thanks,

              Ron