AutoCAD Electrical General Discussion

Reply
Member
rvargas
Posts: 5
Registered: ‎08-13-2004
Message 1 of 5 (259 Views)

Relay Contact Descriptions

259 Views, 4 Replies
08-13-2004 11:47 AM
I have assign a contact description (say: to trip ckt. 1) in the pinlist along with the contact number. Now I like to show the description next to the graphical representation of the contact using the "cross-reference graphical representation feature. Any ideas?

Robert.
*Expert Elite*
testsubject
Posts: 1,077
Registered: ‎03-09-2004
Message 2 of 5 (259 Views)

Re: Relay Contact Descriptions

08-13-2004 12:37 PM in reply to: rvargas
Go to Projects/Miscellaneos and check the "Display cross-referencing in graphical format." Go back to the drawing and re-run Cross-referencing. This should update the coils. The contacts have no graphical format.

Robert Hanrahan
Weigh Right Automatic Scale Co.
ACE user since 1998
Bob Hanrahan
Ace User since 1998
Member
rvargas
Posts: 5
Registered: ‎08-13-2004
Message 3 of 5 (259 Views)

Re: Relay Contact Descriptions

08-16-2004 01:47 PM in reply to: rvargas
Robert,

That's exactly what i'm doing. The problem is that instead of just having the drawing, sheet or location description, i would like to have more information like for example to what circuit that contact is connected. please see the attached file for details.
-Robert
*Nate Holt
Message 4 of 5 (259 Views)

Re: Relay Contact Descriptions

08-17-2004 06:59 AM in reply to: rvargas
AcadE is not currently set up to pull the PINLIST "comments" and add them to the cross-reference text. The only way that I can think of doing this would be to use the AcadE user programming "API" and write a VB or AutoLisp program to postprocess the cross-ref text and add in the comments. This would not be super easy, but an outline of a program to do it is shown below. The hard part is to parse the Mtext text and paste in the comments. The program shown below only has the "easy" part in place. If you like to tinker with programming, give it a shot and see if you can make it work. Cut and paste to a file called "add_pinlist_comments.lsp". APPLOAD it. Type add_pinlist_comments at command line to run it. (defun c:add_pinlist_comments ( / pins_lst lst_main with_comments xdata ss mtext_entname ix) (princ "\nSelect cross-ref MTEXT entities to process") (setq ss (ssget '((0 . "MTEXT")))) ; prompt user to select Mtext objects (if (/= ss nil) (progn (setq slen (sslength ss)) ; number of Mtext entities selected (setq ix 0) ; set counter index to 0 (while (< ix slen) ; "while" loop to process all Mtext ents in selection set (setq mtext_entname (ssname ss ix)) ; get next Mtext ent from selection set (setq ix (1+ ix)) ; increment pointer for next time ; Look for Xdata point on this MText entity pointing back at its parent component (setq xdata (assoc -3 (entget mtext_entname (list "VIA_WD_XREF_BLOCK")))) (if xdata (progn ; target pointer data present on this MText entity. Dig it out (not pretty). (setq coil_hdl (cdr (assoc 1005 (cdr (car (cdr xdata)))))) ; Okay, have "handle" of this Mtext cross-ref's component block insert. Grab ; a copy of the pinlist data that is carried on it. (setq pinlist_data (c:wd_get_1000_xdata (handent coil_hdl) "VIA_WD_PINLIST")) ; Now break apart the pinlist_data. First break up at the ";" semicolons (setq lst_main (c:wd_delim_str_to_lst pinlist_data ";")) ; Now process each pin list pair and look for the "*" flag (setq with_comments nil) (foreach pinpair lst_main (setq pins_lst (c:wd_delim_str_to_lst pinpair ",")) (if (= (length pins_lst) 4) (progn ; 4 entries (ex: "1,P1,P2,*Aux N.O. contact" ; Check 4th for "*" char in first char position (if (= (substr (nth 3 pins_lst) 1 1) "*") (progn ; YES! Found pin pair with comment. Save it. (setq with_comments (cons pins_lst with_comments)) ) ) ) ) ) (if with_comments (progn ; at least one pin pair has a comment, continue to process (setq with_comments (reverse with_comments)) (princ "\nThe following pin combos have comments:") (foreach pinpair with_comments (princ "\n") (princ "1st pin=") (princ (nth 1 pinpair)) (princ " 2nd pin=") (princ (nth 2 pinpair)) (princ " comment=") (princ (nth 3 pinpair)) ) ; Get a copy of the Mtext entity data (setq mtext_entdata (entget mtext_entname)) ; Separate out the TEXT part of it (setq old_text_str "") (setq newed nil) (foreach rec mtext_entdata (if (OR (= (car rec) 3) (= (car rec) 1)) (progn (setq old_text_str (strcat old_text_str (cdr rec))) ) ; ELSE (setq newed (cons rec newed)) ) ) (princ "\nold text=") (princ old_text_str) ; ** the hard part goes here ** ; Now have to parse this Mtext string, find the contacts, match ; with the ones in "with_comments", paste the comment into the right ; spot in the old text string, and then update the Mtext entity ; with this new text string. (setq new_text_str (strcat old_text_str " (this is a test)")) ; test only ; ** end of hard part ** ; Write new text string back out to Mtext entity (setq newed (reverse (cons (cons 3 new_text_str) newed))) (entmod newed) ) ) ) ) ) ) ) (princ) ) "rvargas@rayae.com" <nospam@address.withheld> wrote in message news:5426469.1092689301541.JavaMail.jive@jiveforum1.autodesk.com... > Robert, > > That's exactly what i'm doing. The problem is that instead of just having the drawing, sheet or location description, i would like to have more information like for example to what circuit that contact is connected. please see the attached file for details. > -Robert<nospam@address.withheld> wrote in message news:5426469.1092689301541.JavaMail.jive@jiveforum1.autodesk.com... > Robert, > > That's exactly what i'm doing. The problem is that instead of just having the drawing, sheet or location description, i would like to have more information like for example to what circuit that contact is connected. please see the attached file for details. > -Robert
Member
nguyenphuc
Posts: 4
Registered: ‎06-08-2012
Message 5 of 5 (175 Views)

Re: Relay Contact Descriptions

12-17-2013 07:33 PM in reply to: *Nate Holt

Hi, Nate Holt

I have just read your comment about relay contact description by Autolisp program.

This is very useful macro, so, if available, please kindly send to me the "add_pinlist_comments.lsp" file.

My email: nghi.cas@gmail.com

Wait information from you.

Thank and best regards.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Manufacturing Community
The Manufacturing Community provides additional access to tips, tutorials, blogs and networking with peers.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

New AutoCAD Electrical Category!

The AutoCAD Electrical forum has moved into it's very own category page, and can no longer be found within the Additional Product Forums.

Ask the Community