8 Replies Latest reply on Mar 6, 2018 10:00 AM by alexer

    How can I change Vertex Type in Properties Plane Shape with Automation?

    alexer

      It is required to change Vertex Type in Properties Plane Shape with Automation. For example, Corner to Round, Round to Corner.

        • 1. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
          kendall_hiles

          Frank scripted the Corner to Round and can be found in AATK>FlipChip>DDU>Design Data Trim.  It also lets you set the radius of the curve.

          I do not think we have anything to go from Round to Corner.

          trim1.png

          trim2.png

           

          -kendall

          • 2. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
            .-.--.--

            Going from round to corner is much easier than corner to round, because you don't have to consider the effects (i.e. errors) caused by a very large radius.  For a closed shape, which a plane should be, the resulting number of vertices will equal the number of straight line segments, which is easy to determine from a Geometry XYR PointsArray.  All you need to do is compute the 'point of intersection' for each sequential pair of line segments.  The internet has plenty of websites with formulas for doing that.  Given that the plane shape is controlled by Mentor, you should not have to deal with the special case involving intersection of sequential parallel segments.

            • 3. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
              Patrick.Cashman

              alexer, what essentially has to happen is the following:

               

              get an object

              get the geometry of that object

              get the pointsarray of the geometry

              modify the pointsarray as needed to accomplish what you want.

              delete the first object

              create a new object using the new pointsarray

               

              There is a section in the Mentor Automation help about using pointsarrays. They are a bit complicated, but once you get used to the quirks, no big deal.

               

              The math is the tricky part.  You will have to brush off your geometry and trig skills to do this kind of thing. 

               

              I have some routines that do what you are asking.  I'll be happy to share them with you, but it would be helpful to know where you are in terms of programming ability and if you would be able to integrate them into a project.  If you are just starting out, there are some background things you'll need to get in place first.  Of course many of us are willing to help out and get you pointed in the right direction. Just let us know.

              • 4. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
                alexer

                Thanks all responded!

                When adjusting polygons, you often have to change the angles to round. This takes a lot of time, since you need to make quite a few moves.

                VertexType.jpg

                So I wanted to write a script and bind it to a hotkey. This script would also make the selected vertex type corner or round.

                Polygons often have to be rounded, but polygons with corners are better transformed. Here also it is necessary often to repeat operation a round to the corner.

                Unfortunately, the script offered by kendal, rounds off all corners of the polygon, and I need only selected vertex type.

                It's strange that Mentor has not done something like this for vertex type like this for curved (rounded) traces: push the keys "ctrl" and "alt", pull the corner of the trace and it is curved (rounded).

                I can not understand how using Automation to get to the selected vertex type

                • 5. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
                  kendall_hiles

                  Plane shapes are a points array so you would have to get the points array for the entire shape, find that xy and edit it.

                  When you are in the GUI and see the vertex type, you are basically editing the points array manually in the GUI.  The vertex function is not exposed in automation, it is part of that form.  That is why you can't find it in Automation.

                   

                  Can you explain the use case a little better?  Are you just rounding the inside corners?  If so why?

                   

                  -kendall

                  • 6. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
                    alexer

                    And how to get these same x and y coordinates? How to get points array I know. But how to find this point, which I selected? On the coordinates of the mouse cursor?) I can not think

                    Rounding not only internal, but also external corners. Rounded corners are better in terms of EMI.

                    You can immediately draw rounded corners, but then the polygon is poorly transformed.

                    • 7. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
                      .-.--.--

                      The best way to implement what you want to do (target individual vertices of plane shapes many times over) is by using an IDE form.  The reason is: while the running form is waiting for input (point selection) from you, you can change anything you want in the active view (including Display Control settings).  When you finally select a point, you can process it in the form code (as Kendall noted, this is what Mentor does), and then move on to the next point.

                       

                      I have provided a form that defines its own command (Select Plane Vertex) to which a mouse click event is attached.  The event is only sensitive to left mouse clicks that do not include any combination of the Shift, Ctrl, or Alt keys.  All other mouse events are passed to the application for processing, so you are free to use strokes, menus, pan, zoom, etc., while the form is running.  But a solitary left mouse click will register the cursor location, then search all conductor graphics items that exist on the displayed layers.  It will only examine plane shapes that are not contained in cells, and will find the closest coordinate to the mouse click.  It will then select that plane shape, zoom to its extents, and report the layer, net name, index into the points array for the shape, and the X/Y coordinate at that index.  Now that you can locate that point in its array, you can apply whatever processing you desire (per input from Patrick).  When you finally close the form, it will unselect and unhighlight everything, reset the view to the board extents, and terminate the Select Plane Vertex command.

                       

                      When you save the form, don't forget to set the read-only property for production use.

                      • 8. Re: How can I change Vertex Type in Properties Plane Shape with Automation?
                        alexer

                        Thanks to .-.--.-- and Patrick!

                        It will be useful for writing a conceived script. Now there is no time to finish the script. But how do I finish laying out here, can someone else come in handy. And maybe the process will raise more questions)