|
<< Click to Display Table of Contents >> Navigation: Programming Mechworks PDM > DBWCommandShell > Commands Reference > BOM > BomInsert |
Only for drawings, this command allows to insert a BOM in a worksheet;
It's the API for the toolbar functionality ![]()
call DBWShell("BomInsert UID BOMtemplateFileName AnchorMode IsPointAnchored BomInsertMode")
uid |
unique id of the drawing to create the BOM into. |
|---|---|
BOMtemplateFileName |
the template file for the BOM |
AnchorMode |
available for Solidworks and Solid Edge only. |
IsPointAnchored |
available for Solidworks only |
BomInsertMode |
1: LinkBOMandBalloons mode (default value) |
These are the requirements for using the shell command:
•the current document in the CAD must be a drawing type document
•such drawing must be already registered in the Mechworks database
•a drawing view must be selected (manually before invoking the script or at script level with CAD dependent code)
...
DBWShell("GetActiveDocUniqueId")
DocumentUid = DBWResult("@DOCUMENT_UNIQUE_ID")
DBWShell("BomInsert " & DocumentUid & " DBWBOM_Show|top|level|subassemblies|and|parts|only.txt 3 1 1")
...
DBWShell("GetActiveDocUniqueId")
DocumentUid = DBWResult("@DOCUMENT_UNIQUE_ID")
dbwmsgbox DocumentUid
Set seApplication = GetObject(, "SolidEdge.Application")
If Not seApplication Is Nothing then
dbwmsgbox "Ok seApplication"
set seView = seApplication.ActiveDocument.ActiveSheet.DrawingViews.Item(1)
If Not seView Is Nothing then
dbwmsgbox "Ok seView"
BOMtemplateFileName = "DBWBOM_DRWWeight.txt"
AnchorMode = -1
IsPointAnchored = 1
BomInsertMode = 1
call DBWShell("BomDelete " & DocumentUid & " " & 1)
call seApplication.ActiveDocument.SelectSet.RemoveAll()
call seApplication.ActiveDocument.SelectSet.Add(seView)
call DBWShell("BomInsert " & DocumentUid & " " & BOMtemplateFileName & " 3 1 1")
call DBWShell("BomRefresh " & DocumentUid & " " & 1)
call seApplication.ActiveDocument.SelectSet.RemoveAll()
end if
else
dbwmsgbox "Script is SE specific"
end if