2 Replies Latest reply on Jul 12, 2017 11:48 AM by rtennill

    Unprotect routes via script

    rtennill

      I need to rotate a couple designs to make them consistent with other boards in a stack which means I need to un-glue and protect all objects. I am using a bit of scripting that I found on the forums here to find all protected route segments in a layout and it works great. Rather than go back and manually select and un-protect the traces, I decided to try and clear the protected status but it doesn't work. Should this work or am I just doing it wrong?

       

         'This will search all routesegments in design for protected status

        'if true it adds net to selection status then control "H" add highlight

        'to selected nets "N" will remove highlight from all nets afetwards.

        'based on script from https://communities.mentor.com/thread/18044

        Dim objroute As Object

        For Each objroute In ActiveDocument.RouteSegments

          If objroute.Protected = True Then

          Append("PROTECTED:" & objroute.Net.Name)

          objroute.Net.selected = True

          objroute.Protected = False

          End If

        Next objroute

       

      automation error: "wrong number of parameters".

       

      I also found that the RouteSegment.Protected property is not in the vx1.2 or vx2.1 automation documentation

        • 1. Re: Unprotect routes via script
          md.direct

          Not sure I understand why you need a script to unprotect traces.

          Set your filter to allow for only nets & traces. Then With "Properties", un check the protection.

          You should now have all traces unprotected.

          • 2. Re: Unprotect routes via script
            rtennill

            I wanted to know if this should work because you can glue/unglue parts via scripting. Protecting/unprotecting seems like an equivalent feature that should work.

             

            Currently I don't care about the net names or anything so just selecting everything and unchecking the box is fine. I can see cases where I might want to only select certain nets and that's where a script could come in hand to filter based on name, rule, or some other property.

             

            I see now in the automation object explorer that it only says 'returns' the property not set or return so it is a read only property to automation.