CreateNewBomItem

<< Click to Display Table of Contents >>

Navigation:  Programming Mechworks PDM > DBWCommandShell > Commands Reference > BOM >

CreateNewBomItem

Description

Creates a new child item only for BOM purposes.

Syntax

call DBWShell("CreateNewBomItem DocType DocID Instances FileName [ParentDocUid [MakeBuyString] ]")

Parameters

DocType

kind of the document ("A" for assembly, "P" for part, "G" for generics)

DocID

document id

Instances

document number of instances to show in the BOM

FileName

file name (even if the file doesn't exist).

Please note any space char in filenames and paths must be replaced by "|" char.

ParentDocUid

Optional. document unique id.

MakeBuyString

Optional. the MAKE_BUY field value for the new record being created

Results

@DOCUMENT_UNIQUE_ID

the unique_id of the created bom item

Remarks

If no parent uid is specified, DBWorks browser must be open, Tree Page must be active and a document must be selected.

The command supports the Generic Document type but only when used with the ParentDocUid argument assigned.

When called with no parameters, and if a Tree control was activated with a valid selection, it displays the Create a new Bom Item dialog.

Example

call DBWShell("CreateNewBomItem A spinkler 3 c:\temp\spinkler.sldasm")

if (okDBW = False) then exit sub
new_item_uid = DBWResult("@DOCUMENT_UNIQUE_ID")

or

call DBWShell("CreateNewBomItem G MyDocID 30 c:\temp\MyDocId.txt 258")

if (okDBW = False) then exit sub
new_item_uid = DBWResult("@DOCUMENT_UNIQUE_ID")

or

call DBWShell("CreateNewBomItem G MyDocID 30 c:\temp\MyDocId.txt 258 MAKE")

if (okDBW = False) then exit sub
new_item_uid = DBWResult("@DOCUMENT_UNIQUE_ID")