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