Read data from thread.xls and clearance.xls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I just had my Hole Projector Addin published in the autodesk app store and now I'm working on an update. The app allows you to select hole or slot geometry from one part in an assembly and generate hole features in another component in that assembly based on your selection and other input values.
For the next update I'm adding the options to generate threaded holes and clearance holes, and for this I need to read data from thread.xls and clearance.xls.
The Inventor API exposes some methods to gather data from thread.xls through Application.GeneralOptions.ThreadTableQuery, but these methods are very limited in regards to what data they collect. For example ThreadTableQuery.GetAvailableThreadTypes doesn't let me filter by internal/external, taper etc. Therefore I had to make my own filtering function looping through the available types and finding acceptable threads for holes with a combination of a try-catch statement and creation of ThreadInfo objects (checking that they're not TaperedThreadInfo). This works ok, giving me the same options as Inventors hole command does for tapped holes, but it feels like a pretty ugly workaround:
(Design will be improved before release)
When it comes to clearance holes I haven't found any methods in the API to gather data from clearance.xls at all.
I guess I'll just have to find the paths to these files through the DesignProjectManager and read the xls files, but I'd be surprised if I'm the first one to attempt this so therefore I'm asking here if anyone has a good and proven method already, so I don't have to reinvent the wheel?
Thanks in advance for any input that can help me find the best possible solution 😊
Jhoel Forshav Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website