BOM FORMAT SAVE
BOM FORMAT SAVE
(OP)
Is there a way to create and save a bom format? The format always reverts to the default (AP203) and changes the bill on the drawing. We currently create a new view in the drawing and insert the bill into it (after modifying the format to our standards) then lock that view so the bill does not change to the default (AP203) format when the drawing is opened the next day. This works but it also prevents the bill from updating if there are changes to the product, this is a problem.





RE: BOM FORMAT SAVE
RE: BOM FORMAT SAVE
RE: BOM FORMAT SAVE
Language="VBSCRIPT"
Sub CATMain()
Set productDocument1 = CATIA.ActiveDocument
Set product1 = productDocument1.Product
Set assemblyConvertor1 = product1.GetItem("BillOfMaterial")
Dim arrayOfVariantOfBSTR1(7)
' arrayOfVariantOfBSTR1(0) = "Quantity"
arrayOfVariantOfBSTR1(0) = "Part Number"
arrayOfVariantOfBSTR1(1) = "Type"
' arrayOfVariantOfBSTR1(2) = "Source"
' arrayOfVariantOfBSTR1(3) = "Number"
' arrayOfVariantOfBSTR1(4) = "Part Number"
' arrayOfVariantOfBSTR1(5) = "Revision"
' arrayOfVariantOfBSTR1(6) = "Definition"
' arrayOfVariantOfBSTR1(7) = "Nomenclature"
arrayOfVariantOfBSTR1(2) = "Product Description"
arrayOfVariantOfBSTR1(3) = "Quantity"
' arrayOfVariantOfBSTR1(9) = "Component Description"
' arrayOfVariantOfBSTR1(10) = "Source"
' arrayOfVariantOfBSTR1(11) = "Default Representation Source"
' arrayOfVariantOfBSTR1(12) = "Comment"
' arrayOfVariantOfBSTR1(13) = "List Of Named URLs"
arrayOfVariantOfBSTR1(4) = "Material"
arrayOfVariantOfBSTR1(5) = "Vendor"
arrayOfVariantOfBSTR1(6) = "Process"
arrayOfVariantOfBSTR1(7) = "Block Weight"
assemblyConvertor1.SetCurrentFormat arrayOfVariantOfBSTR1
Dim arrayOfVariantOfBSTR2(0)
assemblyConvertor1.SetSecondaryFormat arrayOfVariantOfBSTR2
End Sub
Regards,
Derek
RE: BOM FORMAT SAVE
Thanks for the info. I'm not familiar with scripts and how to use them. Can you give me a quick lesson on how to do this?
Thanks,
Mike
RE: BOM FORMAT SAVE
- File New Product
- Tools - Macro - Start Recording
If no macro library exists - create 1 under Macro Libraries
rename file, but leave it as a .catvbs
A new menu will pop up with a square in it. This will stop recording.
- Analyze - Bill of Material
- Define Format
setup the columns Press OK
Press OK to exit the analyze box.
Stop Recording
To run the macro
- Tools - Macro - Macros (short cut Alt+F8)
- Run.
Regards,
Derek
RE: BOM FORMAT SAVE
Is creating and running that macro that you described the same thing as the script you wrote? I created the macro and it changes the bom from "ap203 format" to "externalformat.1" and it is setup corectly. I assume that I need to run this macro at every start up? Can i set up to catia to run this macro automatically at start up?
Thanks,
Mike
RE: BOM FORMAT SAVE
From the docs B18doc/English/online/basug_C2/basugbt1903.htm
Title : Running a Macro
cnext -env CATIA.V5R16.B16 -macro E:\tmp\Mymacro.CATScript
RE: BOM FORMAT SAVE
Regards,
Derek
RE: BOM FORMAT SAVE
DBezaire, this is our target on the start-up short cut:
"C:\Program Files\Dassault Systemes\B17\win_b64\code\bin\CATSTART.exe" -run "CNEXT.exe" -env CATIA.V5R17.B17 -direnv "C:\Documents and Settings\All Users\Application Data\DassaultSystemes\CATEnv" -nowindow
can you show me where I add the command to run the macro?
RE: BOM FORMAT SAVE
RE: BOM FORMAT SAVE
You can create your own workbench which can be loaded in start up with your macros...see http://cat
Regards
Fernando
RE: BOM FORMAT SAVE
Can I add the macro to the existing product design workbench? This would be easier than creating a new workbench. Also I did not notice anything about adding a macro to the workbench in the video. How do I do that? If I get the macro into the product design workbench it will run automatically when the workbench is called up?
RE: BOM FORMAT SAVE
Find your macroname.catvbs in the list. Ok
Regards,
Derek
RE: BOM FORMAT SAVE
Derek is right, also Peter's suggestion is good.
What I can suggest you is to create a task in Windows (I saw that you are working under Win) to start-up CATIA running that macro at a specific hour, so when you will enter in the office CATIA will be open and the macro already executed (I'm sure that your IT guy can done this job for you..if you don't have problems with users, passwords a.s.o.).
In this case you have to apply what PeterGuy said (which I believe is the only reasonable solution).
Regards
Fernando
RE: BOM FORMAT SAVE