Match Wire Number Text to Wire Color - 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.
  • 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.
  • 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.
  • 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.
  • You need to be logged in to do that.
  • Posted September 4, 2009

    by Nate Holt

    Here is a simple user request that finds a happy solution using the AutoCAD Electrical "API". A small AutoLISP utility with a few embedded AutoCAD Electrical API calls does the trick.

    The Request

    Out-of-the-box, AutoCAD Electrical pushes all wire number text out to the user-defined layer under "Drawing Properties". In the example drawing below, the wire numbers all appear yellow because the defined WIRENO layer itself has been set to default to yellow.

    But the user prefers to see the wire number take on the color of the wire it is tied to. So wire numbers 59, 60, and 61 display as gray, 64 and 65 red, and the rest white.

    So, how to do this? All that is needed is a little post-processing utility to find wire number attributes, find the layer of the wire that the wire number ties to, and flip the attribute's layer to match that wire layer.

    The AutoLISP Utility

    Here is one way to do it. This AutoLISP utility includes a half-dozen calls into the AutoCAD Electrical API.

    Download file from this link, rename to wn_textcolor.lsp

    files/21301_21400/21353/file_21353.lsp

    To Use

    Download the utility and rename it to wn_textcolor.lsp. APPLOAD it. Then type WD_TEXTCOLOR [Enter] at the command line.

    Result

    Here's the "after" version:

    The utility should also find and move the "extra wire number copies" and any wire number leaders.

    0 Comment | Add Comment

Comments



You must be logged in to post a comment.

Submit a Tip

Share your tips with the community.

Submit

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