Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

BOM FORMAT SAVE

Status
Not open for further replies.

huntwe

Automotive
Feb 15, 2008
34
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.
 
Replies continue below

Recommended for you

I was also wondering about this, so I read the catia help. It says that "You cannot save the formats you create. Customized formats are specific to your CATIA session." So it seems that it is not possible, sorry.
 
Thanks for the info...I do not have access to the catia help section. I wonder why catia would not allow you to customize a bom? Doesn't make any sense.
 
You can make a script for this. I don't write them and managed to create this one.

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
 
Derek,
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
 
Start a fresh session of Catia
- 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
 
Derek,
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
 
Change your startup short cut to call the macro (you might find this slows startup due to CATIA having to load lots of extra libraries)

From the docs B18doc/English/online/basug_C2/basugbt1903.htm
Title : Running a Macro

cnext -env CATIA.V5R16.B16 -macro E:\tmp\Mymacro.CATScript
 
Mike, I run it before creating the BOM. You can make an icon for it under - Tools - Customize - Commands - Macros.

Regards,
Derek
 
Thanks Derek, That will definately work but I would like to take it one step further to eliminate that step if possible.
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?
 
I created a macro for the bom format and it works great. The problem is that you have to be in a product to run the macro. This makes it not possible to run the macro at catia start-up. Is there a way to get around this?
 
Ferdo,
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?
 
Huntwe, it would not run when the workbench is started. To add it as an icon - Start the ASD workbench, Tools -- Customize -- Toolbars. Select the toolbar to add the macro, Add Commands.
Find your macroname.catvbs in the list. Ok

Regards,
Derek
 
Hi,

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
 
For now I have created an icon in the assembly design workbench. I will just have to remember to run the macro when I need it. It seems the only way to run this macro automatically is to figure out how to run it without being in the product, or, create a different macro that could run outside the product.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor