Wishful thinking, or a possibility?

Wishful thinking, or a possibility?

D.Wheeler3GADA
Advocate Advocate
350 Views
3 Replies
Message 1 of 4

Wishful thinking, or a possibility?

D.Wheeler3GADA
Advocate
Advocate

Greetings,

       After the success of my initial coding endeavor, I would like to present my employer with another idea for a coding side project. Before I present the idea or dig into research on it, I'd thought I'd ask here to see if this is a possibility, or if I am mistaken in assuming it can be done...

 

I'd like to create an iLogic rule that resides in our assembly template (so it is always there when creating a new assy file) that will accomplish the following:

 

1) export the BOM to an Excel file that resides in the folder with the assy (creating it if it doesn't already exist)

 

2) rename the Excel file to include a current time/date stamp (We would only want to keep the one "latest & Greatest" file)

 

3) create a pdf from the Excel file (with the same date stamped filename) and open it.

 

I am fairly certain I can accomplish this with iLogic, but here's the caveat:

 

I want to use VBA to create an application for this that a non-Inventor user can run from their desktop. Essentially, this would give admin the ability to pull a BOM report without requesting it from a designer. My thought process is that as long as the iLogic rule resides inside of the assemblies on the network, I could use VBA to launch the rule from any PC connected to the network...

 

I'm thinking there could be logistical/permission issues if someone happens to be in the assembly when Admin runs the app. Even if the app can only pull the last saved version of the BOM, that would be acceptable for the purposes at hand.

 

If anyone can save me considerable time and frustration by informing me if this is just wishful thinking, I'd be both humbled and grateful. 

 

If this can be accomplished, I'd like to try to piece it all together myself before I return for advice/help from the forum if I hit a wall...

 

FYI - I have thought about just creating a trigger event that creates/updates the spreadsheet & pdf every time the assembly is saved, but that is kind of overkill, and may lead to the assumption (by Admin) that the assy is completed and released. If they use a desktop app to pull the report, the assumption would always be that it is a preliminary report (and if this all seems doable, I may add a watermark to the pdf output that indicates the design is not released). 

 

As always, thank you to all!

0 Likes
Accepted solutions (1)
351 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @D.Wheeler3GADA.  Steps 1 & 2 sound pretty simple for an iLogic rule, but step 3 might be a stretch for an iLogic rule.  You would likely have to add a reference to the Excel API Object Library, then work your way through that system to use its Export methods, so it is still likely possible with iLogic though.  Including a watermark on the exported PDF I would not know how to do at this time though.  I am not a standalone application programming expert, so I  would not have a lot of insight there, but I would be a bit concerned about using VBA coding language for that project, since it seems to be on its way out.  Inventor has completely stopped including it in its installs, due to security concerns, because Microsoft is not keeping up with updates for it.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4

D.Wheeler3GADA
Advocate
Advocate

@WCrihfield ,

    Thank you for the tips/advice. I was unaware that there are security issues with VBA. I may still toy around with it to see if I can achieve step 3, but on my own time. I will most likely adapt the Event Trigger method so that there will be an exported BOM for reference at all times.

 

Thanks again! 

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor
Accepted solution

This all seems possible and you may even be able to utilize Inventor Read only to Export a BOM but I have no experience with this so it might be a dead end. See link here

 

I would have a reservation about  trying to start up an inventor session on a computer not solely dedicated for this task although I am not an expert it sounds fraught with challenges on permissions as well as performance issues it may bring to the active user. 

 

What does sound easier is to just Export the assembly BOM on each save. How to flag the BOM as released will depend on your release to production/purchasing policies. At some point your designer needs to pass this information along to the various departments as to the status of the BOM. Just because it has a time stamp doesn't mean it is suitable for others to use. 

 

Regarding creating a pdf of the exported excel file this is just a save as in PDF in VBA. As with all document creation it takes a little time depending on server setting so it could be done purely from the Admins location. Launch the export to pdf directly in excel or in a standalone vb Script (.vbs file ) launched from windows which could copy both the PDF and excel workbook to the admins folder structure. 

 

AAcheson_0-1655063313203.png

 

As a side note the apprentice server is not suitable for BOM export as I have found in a few forum posts searching the same functionality. This would have been a light weight solution to exporting the BOM without running the full inventor application. I assume you don't have vault as this would be an easier option? 

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes