Home > Community > Forums > Custom IC SKILL > How to know if a terminal pin is in the left,right,top and bottom of a circuit symbol?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 How to know if a terminal pin is in the left,right,top and bottom of a circuit symbol? 

Last post Sun, Nov 11 2012 5:50 PM by Reinice. 2 replies.
Started by Reinice 08 Nov 2012 09:28 PM. Topic has 2 replies and 663 views
Page 1 of 1 (3 items)
Sort Posts:
  • Thu, Nov 8 2012 9:28 PM

    • Reinice
    • Top 150 Contributor
    • Joined on Thu, Jul 26 2012
    • Posts 59
    • Points 915
    How to know if a terminal pin is in the left,right,top and bottom of a circuit symbol? Reply

    Hi All,

    How can I know if a terminal pin is in the left,right,top and bottom of a circuit symbol? and how to count them?

    ex.

    left - 13 terminal pin

    right - 10 terminal pin

    top - 2 terminal pin

    bottom - 0 terminal pin

    Thank you very much in advance.

    Best Regards,

    Reinice

    • Post Points: 20
  • Sat, Nov 10 2012 8:12 AM

    Re: How to know if a terminal pin is in the left,right,top and bottom of a circuit symbol? Reply

    Reinice,

    Here's a function I've used to categorize the side a pin is on (based on the xy (e.g. centerBox) of the pin):

        /***************************************************************
        *                                                              *
        *                  (abGetClosestEdge xy bBox)                  *
        *                                                              *
        *  INTERNAL function to return one of the symbols left, right  *
        *   bottom or top to indicate whether the specified point is   *
        *  closest to which edge - given a bBox of the symbol - prior  *
        *  to adding pins or labels. Helpful to determine orientation  *
        *                       of labels, etc.                        *
        *                                                              *
        ***************************************************************/
        (defun abGetClosestEdge (xy bBox)
          (let (edgeData distances)
            (setq edgeData
                  (list
                    (list (xCoord (lowerLeft bBox)) (xCoord xy) 'left)
                    (list (yCoord (lowerLeft bBox)) (yCoord xy) 'bottom)
                    (list (xCoord (upperRight bBox)) (xCoord xy) 'right)
                    (list (yCoord (upperRight bBox)) (xCoord xy) 'top)
                    ))
            (setq distances 
                  (foreach mapcar edge edgeData
                           (list (abs (difference (car edge) (cadr edge)))
                                 (caddr edge))))
            (cadar (sortcar distances 'lessp))
            )
          )
     
    Maybe that will get you started?

     

    Andew

    • Post Points: 20
  • Sun, Nov 11 2012 5:50 PM

    • Reinice
    • Top 150 Contributor
    • Joined on Thu, Jul 26 2012
    • Posts 59
    • Points 915
    Re: How to know if a terminal pin is in the left,right,top and bottom of a circuit symbol? Reply

    Hi Andrew,

    I'll work with your script as a starting point. I'll inform you later what will be the outcome.

    Thanks and Regards,

    Reinice

    • Post Points: 5
Page 1 of 1 (3 items)
Sort Posts:
Started by Reinice at 08 Nov 2012 09:28 PM. Topic has 2 replies.