Making the Part Number fit the Relay Contacts used - AutoCAD Electrical

  • Oh no! An error has occurred!
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • You need to be logged in to do that.
  • Coinciding with the acquisition of VIA Development, Nate joined Autodesk in March of 2003 after a decade stint as an entrepreneur following a two-decade stint as a controls engineer and software applications developer at Owens-Corning. Nate is now the lead product architect for AutoCAD Electrical. He loves this stuff.

    About Nate

Latest Post

  • Making the Part Number fit the Relay Contacts used - AutoCAD Electrical
    April 2, 2007, 02:08 PM Nate Holt

    This user-request makes sense... he inserts the parent relay coil symbol and assigns the desired manufacturer code. But does not make a specific catalog number assignment until after the design is nearly complete. At this point he wants to go back to each relay coil symbol and make a catalog assignment selection based upon the EXACT number of that relay's contacts that he actually used in the design.

    Makes sense. But AutoCAD Electrical is currently not set up to automatically figure this out "after-the-fact". It would need to gather up a list of all of the relay's child contacts (it knows this already), go through the PINLIST table in the catalog lookup database file to find all wild-card entries that match this number of NO/NC/Form-C contact combination (it has access to this PINLIST data), then go through the relay catalog lookup table (it has access to this too) and find all catalog numbers of the target MFG that match any of the wild-card PINLIST values that have the exact number/type of needed contacts.

    So, the bottom line is this: AutoCAD Electrical has the various parts and pieces of data needed to do it, but this option is just not current programmed into the product.

    Extending AutoCAD Electrical through its API

    Okay, let's try to rough out some AutoLISP code to try to make this happen! Some snippets of the overall program are shown below (this utility was quickly assembled from parts and pieces of other utilities, so some stuff may not be used).

    Here's where we prompt the user to pick on the parent coil. The utility gathers up the TAG1 attribute value, the symbol's "handle", and the INST and LOC attribute values in case we're in IEC-tag mode. A call to messy function "xref_get_data" (in the AutoLISP utilty but not shown here) does a query on the project's scratch database to find information on all of our picked parent's child contacts. Then the utility adds them up to get counts of NO, NC, and Form-C contacts used.

    cat4_combo_05.png



    Next: Collecting a list of PINLIST wild-card matches

    cat4_combo_02.png



    Next: Collecting a list of catalog part number matches

    cat4_combo_04.png



    Finally: Displaying in the dialog pick list

    cat4_combo_03.png



    Testing this Utility

    Download the AutoLISP file here and the companion dialog DCL file here. Make sure you put the DCL file somewhere in the ACAD path.

    1. APPLOAD the AutoLISP file
    2. Type CAT4_COMBO [Enter] at command line

    Here it is!

    Here we've picked on a relay coil symbol that has four child contacts used through the project drawing set. There are three N.O. contacts and one N.C. contact used. Note that the listing shows the 3NO/1NC combos plus 4NO "convertible" entries as well!

    cat4_combo_01.png

    Go for it !

    This utility is really rough. Don't hesistate to experiment with it and make it better...!


    0 Comment | Add Comment Controlling the Machine > All

Comments



You must be logged in to post a comment.

Subscribe to Blog

Want to keep up with the latest? Subscribe to the RSS feed today.

RSS

Tags

You must be logged in to add a tag.

Send to a Peer

You must login to share pages.

Feedback

Tell us what you think of the site.

Send Feedback