Quantcast
Channel: Mentor Graphics Communities: Message List
Viewing all articles
Browse latest Browse all 4541

Re: Changing padstack in a PCB design

$
0
0

OK, I lied.  Actually I had just never looked into this, so I thought it would be harder.  But it's not.

 

Sub change_pin()

         Dim pstack As MGCPCB.Padstack

         Dim pstack_name AsString

         Dim pin As MGCPCB.Pin

         Dim pins As MGCPCB.Pins

        

         pstack_name = "p:ex70y70d38a"

         pstack = doc.PutPadstack(1, 1, pstack_name, False, False)

        

         pins = doc.Pins(1)

         ForEach pin In pins

             If doc.TransactionStart(0) Then

                 pin.CurrentPadstack = pstack

                 doc.TransactionEnd(True)

             EndIf

         Next

EndSub

 

The above works.  pin.CurrentPadstack is the key command. Of course you could do it differently, by feeding it the pin to change, the new padstack name, etc., as needed by what you are trying to do. I used it to change an SMT pin to a through hole pin and it didn't complain.  The transaction mode 0 I used means no DRC, so use it with caution.


Viewing all articles
Browse latest Browse all 4541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>