File Directory For Custom Add-in not Working for Vault
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Last Summer we had an intern who was very, very smart write an Add-in for inventor. We call it Easy BOM. It takes our top level model and ultimatley spits out a Strucutured BOM and a Parts Only BOM in an excel spread sheet. Additionally, it sorts a particular way, and then runs a bunch of back ground macros so when we open the .xlsm file, it has removed things we don't want, and high lighted things in a certain way...etc. It saves us a bunch of time and is always consistent with output. A large machine might take 20 minutes to export the BOM using Easy BOM add-in, but the manual process to create that same BOM could take 2-6 hours depending on Assembly complexity.
In any case, the original Add-in code was written for our usage of Inventor not in Vault, and it was on our server (we call it the "R-drive"). Now that we are using Vault, everything is local and the file structure of vault is somewhat different than the network server we were using.
This is what the original file structure looked like.
R:\Customer\Job No\Mech\CAD\Assembly,Parts,BOMs (these three folders existed in CAD). (Italics are variable)
Where the top level assembly 23G45678-T00 would be in the Assembly folder and the BOM would be created in the BOMs folder.
All projects have this exact structure once you get to the Job No folder level. This is an image of the original Structure.
Now that we have moved to Vault, it is somewhat simplified and it lives locally.
C:\\RND-LWR\Workspace\Projects\Customer Name\12R34567-T00.iam (Italics are variable)
I'd like to avoid create a BOMs folder in the Customer Name folder, I'd just like the BOM to be created at the same location as the -T00.iam file.
This is an image of the Vault Structure
This is the code snippet the controls calling the templates to export to and from as well as where to create them. Text in Bold Green is governing where the files go.
sTemplateDrawing = "K:\Inventor\R2022 Inventor\R2022 Templates\_RND\BOM Detail.idw"
oForm.ProgressBar1.Value = 1
oOptions = g_inventorApplication.TransientObjects.CreateNameValueMap
oOptions.Value("Template") = "L:\Mechanical\TEMPLATES\CombindedBOMTemplateNested_New2.xlsm" 'If the name of the template is changed, chnge this let chad know that changing names (ie adding _New) will break this addin
oOptions.Value("ExportedColumns") = "QTY;MULT MACH QTY;QOH;QTY TO ORDER;PART NUMBER;TITLE;REV;USED ON ASSEBMLY;ESTIMATED COST;MANUFACTURER;Manufacturers P/N;MATERIAL;Material2;Finish1;SPARE?;IndustryNo;BOM Responsibility"
oOptions.Value("StartingCell") = "B3"
oOptions.Value("TableName") = "Parts List"
oOptions.Value("IncludeTitle") = False
oOptions.Value("AutoFitColumnWidth") = True
sPartsListPath = Strings.Left(sFilePath, InStrRev(sFilePath, "\CAD\")) & "CAD\BOMs\"
sPartsListName = Strings.Right(sFilePath, Strings.Len(sFilePath) - InStrRev(sFilePath, "\"))
sPartsListName = Strings.Left(sPartsListName, InStrRev(sPartsListName, "-")) & "B" & Strings.Right(sPartsListName, Strings.Len(sPartsListName) - InStrRev(sPartsListName, "-T") - 1)
sPartsListName = Strings.Left(sPartsListName, InStrRev(sPartsListName, ".") - 1)
sBOMCustomizationPath = "K:\Inventor\R2022 Inventor\Customization\PartsOnlyBOMStructureWMicro.xml"
CAn anyone suggest a change to the code that would allow a BOM to be created in the same folder as the top level in our new Vault File structure?