6 Replies Latest reply on Dec 19, 2013 3:31 PM by john_dube

    How can I find all the 4 way net connection points in a schematic?

    avjohn

      I just found out from our printed circuit design folks that we will no longer allow 4 way net connections in our schematics.  What I mean by a 4 way net connection is that this is where a user connects 4 nets at a single point on a sheet.

       

      Is there anyway to script this?

       

      Thanks,

       

      Tony

        • 1. Re: How can I find all the 4 way net connection points in a schematic?
          john.decker

          I would also like to have a script that could do this; would be nice to find out if it can be done.

          • 2. Re: How can I find all the 4 way net connection points in a schematic?
            john_dube

            Tony,

             

            You can just loop over all segments of all nets, and keep track of the number of solder dot joints at a particular location.  If there are 4 segments with the same solder dot joint, you have a 4 way net connection.

             

            Dim objNet, objSeg, iJoint, iJointX, iJointY, sKey
            Dim dictSolderJoints : Set dictSolderJoints = CreateObject("Scripting.Dictionary")
            ForEach objNetIn vdapp.ActiveView.Query(VDM_NET, VD_ALL)
                ForEach objSegIn objNet.GetSegments
                    For iJoint = VDJ_LOWTo VDJ_HIGH
                        iJointX = objSeg.Location(iJoint).X
                        iJointY = objSeg.Location(iJoint).Y
                        sKey = iJointX & "," & iJointY
                        If objSeg.GetJointType(iJoint) = VDJT_SOLDERThen
                            dictSolderJoints(sKey) = dictSolderJoints(sKey) + 1
                        EndIf
                    Next
                Next
            Next

            ForEach sKeyIn dictSolderJoints
                If dictSolderJoints(sKey) > 3Then
                    MsgBox"4 way solder joint at " & sKey
                EndIf
            Next

             

            This script works with the current sheet, you can extend the script to iterate over all schematic sheets (make sure to clear out the dictSolderJoints dictionary for each sheet).

             

            John

            • 3. Re: How can I find all the 4 way net connection points in a schematic?
              avjohn

              Thanks!!!  I'll try this out.

               

              Tony

              • 4. Re: How can I find all the 4 way net connection points in a schematic?
                avjohn

                The code works great and is greatly appricated!

                 

                Thanks!

                 

                Tony

                • 5. Re: How can I find all the 4 way net connection points in a schematic?
                  mcrist

                  I'd like to create a list of these ties across an entire schematic without having to open each sheet, then present the list to the user.  After presenting the list to the user, I'd like to allow the user to open the schematic sheet where the tie is listed and select it.  find_4_ways.png

                   

                  I've seen a post somewhere on here how to visit each schematic sheet without opening it (not this one: http://communities.mentor.com/docs/DOC-1345) to search for all the nets.  But I can't seem to find it now.  Even after finding all the nets in the design, how do I keep track of which schematic sheet that net / 4 way tie is on, then how do I open a view of that tie and zoom in to it?  On the single sheet version, I just do:

                   

                   

                    Private Sub Jump_To_tie(ByVal index As Integer)
                          vdApp.ActiveView.Block.DeSelectAll()

                          For seg As Integer = 0 To fourwayties(index).pointcount - 1
                              vdApp.ActiveView.SelectSegmentByJointLoc(fourwayties(index).X(seg), fourwayties(index).Y(seg), ViewDraw.VdJointType.VDJT_SOLDER)
                          Next
                          vdApp.ActiveView.ZoomSelect()
                      End Sub

                   

                   

                   

                  The fourwayties is a List(Of tie), and tie is a class:

                   

                   

                      Class tie
                          Public X As List(Of Integer)
                          Public Y As List(Of Integer)
                          Public pointcount As Integer
                          Public seg As ViewDraw.CVdSegment
                          Public joint As Integer
                          Public block As ViewDraw.Block
                      End Class

                   

                  so I can add anything to the dictionary or class that I need for a specific tie.

                   

                  My questions are:

                  - How do I find all of the segments on all nets across the entire design without opening each schematic sheet?

                  - What do I need to store for a joint so I can reference it later?

                  - How do I jump to a joint based on the info stored previously and zoom in on it?

                   

                  I've seen pieces of the answer in this forum previously, but can't seem to find them now.

                   

                   

                   

                   

                  fixed script formatting

                  • 6. Re: How can I find all the 4 way net connection points in a schematic?
                    john_dube

                    You can try Application.DesignNets, however I don't have any first-hand experience with using this method. 

                     

                    Assuming that works, just record the schematic name (block and sheet name), then update your JumpToTie to open the sheet before calling ActiveView.SelectSegmentByJointLoc.

                     

                    John