AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I display company internal USER1 catalog part numbers on components?

6 REPLIES 6
Reply
Message 1 of 7
Anonymous
905 Views, 6 Replies

How do I display company internal USER1 catalog part numbers on components?

(note: this question came from a source outside of the discussion group but a response is shown here as it may be of general interest) I want to have my internal part numbers displayed as visible attributes on parent schematic components. I'm thinking of entering them in the USER1 field of the catalog lookup table records but I don't know how to map them to the component when I do a normal "catalog lookup" selection. Any suggestions? REPLY: If you're not concerned about having these internal part numbers show up in BOM reports but just want them to be visible as attribute text on the components, the quick way is to enter your internal part number in the TEXTVAL (or TEXTVALUE) field in the desired catalog lookup records. Most schematic parent symbols have three DESCn attributes. Use DESC3 as an existing attribute to display your internal part number coding. In the TEXTVAL/TEXTVALUE field, enter this: DESC3=. Now, when you do catalog lookup and select a part number (that has been modified as above), your internal part number will map to the component's DESC3 attribute. If you don't want to give up your DESC3 attribute but are willing to take the time to add a new attribute to selected parent component symbols, do it. Let's say you add attdef "INTERNAL_PN" to each parent schem library symbol. Now encode the TEXTVAL/TEXTVALUE field with INTERNAL_PN=. If you DO want this internal part number to also show up in your BOM reports, do either of the above PLUS put your part number into the USER1 field of the catalog record. Now, you'll see the part number visible on the component and also show up in the "USER1" column of the BOM and COMPONENT reports.
6 REPLIES 6
Message 2 of 7
mbrown
in reply to: Anonymous

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.
Message 3 of 7
Anonymous
in reply to: Anonymous

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.
Message 4 of 7
mbrown
in reply to: Anonymous

Thanks
Message 5 of 7
mbrown
in reply to: Anonymous

The routine works fine except for one small problem. The USER1 information that the routine is finding is for the sub-assembly not for the main part. IE on a relay we use an icecube style relay and base which have there own part numbers. The base is the sub-assembly. The USER1 info being shown is the sub-assembly base. Is there a way to show both the USER1 info for the relay and the base? Is there a way to show the CATALOG name for both also?
Message 6 of 7
Anonymous
in reply to: Anonymous

You're exactly right, when the catalog lookup sees a "subassy" catalog item,
this is coming back as well and is at the top of the list of returned data.
I've modified the code to try to always use the main part number (reverse
the list of returned data and pick the first record). See if this works.
Don't be afraid to modify the utility to suit your needs. It's fun.

Nate.




; ** 22-Nov-05 NEHolt created for discussion group issue
(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))
; get "CAT" attribute or xdata value
(if (AND (setq cat (c:wd_get_pnlval ben "CAT"))
(/= 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 x ; some data returned, use only or last record returned
; (will be the "main" part number),
; the sub-assy items will be at the top of the list
(progn
(setq x (reverse x)) ; reverse the list to make
; sure main part number is first
(setq cat_rec (car x)) ; get first (or only) record
; 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 USER2 value, write out to USER2
; attribute on block insert
(c:wd_modattrval ben "USER2" (nth 13 cat_rec) nil)
) )
(if (/= (nth 14 cat_rec) "") ; USER3 value
(progn ; non-blank USER3 value, write out to USER3
; attribute on block insert
(c:wd_modattrval ben "USER3" (nth 14 cat_rec) nil)
) )
) )
) )
)
(princ)
)






wrote in message news:5019954@discussion.autodesk.com...
The routine works fine except for one small problem. The USER1 information
that the routine is finding is for the sub-assembly not for the main part.
IE on a relay we use an icecube style relay and base which have there own
part numbers. The base is the sub-assembly. The USER1 info being shown is
the sub-assembly base. Is there a way to show both the USER1 info for the
relay and the base? Is there a way to show the CATALOG name for both also?
Message 7 of 7
mbrown
in reply to: Anonymous

Nate,
The lisp routine has been working great but I have another problem. I need it to also obtain the user information on certain child symbols as well as parent symbols. Can you help?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost