Right now, there's not a good way within the application to do this. It is
not currently supported. But there is a work-around. If you APPLOAD the
attached utility and then type USER_CAT_2_SYMBOL [Enter] at the command
line, you can pick your devices and it will populate your added USER1,
USER2, and USER3 attributes on your modified symbols with the fields from
the catalog lookup. You can easily modify this routine to suit your needs.
It makes use of a couple calls from the AcadE "API".
Nate.
(defun c:user_cat_2_symbol ( / x xx cat_rec ben blknam mfg cat assycode)
; Utility to populate picked component with USER1/USER2/USER3
; values pulled from catalog lookup file
(while (setq x (entsel "\nPick component:"))
(setq ben (car x))
(if (AND (setq cat (c:wd_get_pnlval ben "CAT")) ; get "CAT" attribute or
xdata value
(/= cat ""))
(progn
(setq mfg (c:wd_get_pnlval ben "MFG"))
(setq assycode (c:wd_get_pnlval ben "ASSYCODE"))
(setq blknam (c:wd_get_pnlval ben "WDBLKNAM"))
(if (OR (not blknam)(= blknam ""))
(progn ; get actual block name
(setq blknam (cdr (assoc 2 (entget ben))))
) )
; Do catalog lookup on the target MFG/CAT/ASSYCODE combo
(setq x (wd_cat3_getcat nil mfg cat assycode blknam))
(if (AND x (/= (nth 16 x) "")) ; some data returned, use first or
only record
(progn
(setq cat_rec (car x))
; nth7=catalogdesc, 8=query1, 9=query2,....14=user3
(if (/= (nth 12 cat_rec) "") ; USER1 value
(progn ; non-blank USER1 value, write out to USER1 attribute
on block insert
(c:wd_modattrval ben "USER1" (nth 12 cat_rec) nil)
) )
(if (/= (nth 13 cat_rec) "") ; USER2 value
(progn ; non-blank USER1 value, write out to USER1 attribute
on block insert
(c:wd_modattrval ben "USER2" (nth 13 cat_rec) nil)
) )
(if (/= (nth 14 cat_rec) "") ; USER3 value
(progn ; non-blank USER1 value, write out to USER1 attribute
on block insert
(c:wd_modattrval ben "USER3" (nth 14 cat_rec) nil)
) )
) )
) )
)
(princ)
)
wrote in message news:5019339@discussion.autodesk.com...
This works but I need it to find the info in USER1 field without having to
retype it in the textvalue field. IE USER1=... I know there must be a way
because a symbol will find the CAT, MFG and other info from the database.