PDA

View Full Version : sd-set-library-attr ?


robban
11-24-2003, 01:45 AM
I want to set some attr. to some parts that make them not hatched in anno, (as with sd libery parts)
and to get the name etc. in to bom.

Is this the funktion to use? (sd-set-library-attr )

could it be used from a dialog, so that i can select part ?

Robban

John van Doorn
11-24-2003, 10:34 AM
Hi Robban,

If you want to prevent annotation from automatically
hatching your parts you can use the command:

(DOCU::DOCU-SET-SECURE-SECTION-FLAG-OF-PART sel_item T)
Be aware that Annotation needs to be running when applying this command.

The question on How to get the name into the BOM, depends if you are using DesignManagement or just the BOM included with Annotation?

Please let me know what kind of BOM you are referring to?

john

robban
11-24-2003, 11:43 AM
Hello John,

Yes I know that I can use: (DOCU::DOCU-SET-SECURE-SECTION-FLAG-OF-PART sel_item T)
but ... I have a lot of standard parts that I use very often so I like to set this attr. once, if it possible, and store them.


I want to use the included BOM or the one in 3D-Docu (sd2004)
But I think it is the same attr. for both.
If you want to prevent annotation from automatically
hatching your parts you can use the command:

Robban

John van Doorn
11-25-2003, 11:05 AM
Robban,

The setting of not sectioning your part is stored into the part itself.

This means when you reload your part and use it in an other assembly you don't have to set it again.

The scan bom from 3D doc is only used to set the position number and or qty.
The configuration on what columns you want to show in annotation or Designmanagement can be configured either in design management or am_customize


Annotation example:

(docu-unload-all-bom-layouts)
(docu-load-bom-head-layout
:ui-name "Custom-bom"
:file "D:/cocreate/custom/head1.mi")

(docu-load-bom-comp-layout
:ui-name "Custom-bom"
:file "D:/cocreate/custom/row1.mi")

(docu-load-bom-flag-layout
:ui-name "Custom-bom"
:file "D:/cocreate/custom/flag1.mi")


;;-----------------------------------------------------------------------------
;; convenience functions to inquire attached BOM information
;;-----------------------------------------------------------------------------

(defun bomattr-get-material (selitem)
(let ((attr (sd-inq-item-attribute selitem "bom-attribute"
:values :attachment :contents)))
(if attr (getf attr :material) nil)
)
)


(defun bomattr-get-remark (selitem)
(let ((attr (sd-inq-item-attribute selitem "bom-attribute"
:values :attachment :contents)))
(if attr (getf attr :remark) nil)
)
)


;;-----------------------------------------------------------------------------
;; customizing off BOM attributes
;;-----------------------------------------------------------------------------

(defun my-bom-attr-part-name (selitem)
;Use the basename for the partname
(oli::sd-inq-obj-basename selitem)
)


(defun my-bom-attr-part-no (selitem)
;Use the contentsname for the partnumber
(let ((part-no (oli::sd-inq-obj-contents-name selitem)))
(if part-no part-no "")
)
)


(defun my-bom-attr-material (selitem)
(let ((material (bomattr-get-material selitem)))
(if material material "")
)
)

(defun my-bom-attr-remark (selitem)
(let ((remark (bomattr-get-remark selitem)))
(if remark remark "")
)
)

(defun my-bom-attr-density (selitem)
(if (sd-inq-part-p selitem)
(oli::sd-inq-part-density selitem)
)
)



(docu::docu-unregister-bom-attr-all)

(docu::docu-register-bom-attr :attr-type "DOCU_BOM_QUANTITY"
:attr-title "Quantity"
:attr-display t
:attr-value-fnc nil) ;; system bom attribute

(docu::docu-register-bom-attr :attr-type "PART_NAME"
:attr-title "Part Name"
:attr-display t
:attr-value-fnc #'my-bom-attr-part-name)

(docu::docu-register-bom-attr :attr-type "PART_NO"
:attr-title "Part No"
:attr-display t
:attr-value-fnc #'my-bom-attr-part-no)

(docu::docu-register-bom-attr :attr-type "MATERIAL"
:attr-title "Material"
:attr-display t
:attr-value-fnc #'my-bom-attr-material)

(docu::docu-register-bom-attr :attr-type "REMARK"
:attr-title "Remark"
:attr-display t
:attr-value-fnc #'my-bom-attr-remark)

(docu::docu-register-bom-attr :attr-type "DENSITY"
:attr-title "Density"
:attr-display t
:attr-value-fnc #'my-bom-attr-density)



John