Automating scaling assemblies to prepare for 3D printing
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
Please forgive my limited experience, I'm plenty experienced in the CAD side of the software, but not so much on everything behind the scenes like automation and coding.
I'm currently working as an intern at an engineering firm for Mechanical Engineering degree and my assignment is to create a standardized workflow for converting models in Inventor to 3Dprint-ready models.
For 3D printing models, you can't just export to STL and be done with it, many steps need to be taken to ensure the model can actually be printed. My main challenge right now is on how to scale assemblies to prepare them for 3D printing. Yes, it's possible to do the scaling in the last step (slicer) and that would work, but it also means adjusting dimensions in the live model while constantly keeping the scaling factor in mind. The goal of this workflow is to have less experienced engineers (who might not know the full ins and outs of the model) to be able to make it print-ready when given a large assembly, which is why I want it to be as intuitive and standardized as possible.
Currently, I just can't find a good solution for this problem, which is why I'm coming to the forums to see if anyone knows an actual solution. Here are the ideas I've had (and tried), which have so far all had their downsides.
The first thing I tried were ways for actually scaling the full assembly and having it easily adjustable;
- Derived part method, as far as I know this is the most reliable way of scaling something like an assembly. Unfortunately, the assembly this creates (after making a derived part, and turning that into an assembly with 'Make Components') has just a bunch of unconstrained solid bodies, so these would be hard to make fine adjustments too. All the parts are also unconstrained, so any adjustments would just glitch them into each other.
- DirectEdit -> Scale method. This step would be extremely tedious to do by hand, as you would have to go into each component and use the command to scale it. My solution was to attempt to automate this process using various methods, all of which failed. I tried 3 things, using iLogic, VBA editor and an external plugin, neither worked. To my knowledge, all of these methods can't actually access the DirectEdit -> Scale feature. As Inventor doesn't expose this in their API, so there is no way to automate this process.
After these methods failed, I tried a second approach. Having a scaled reference part of the assembly that will update when making changes, allowing you to check dimensions (of the scaled model) using the measure tool.
This method would be a bit less intuitive, as any adjustments you make would still need to keep the scaling factor in mind, but it's better than nothing.
- Derived part method. I went back to this method as I figured it would be perfect for the reference part, as solid bodies and lack of constraints wouldn't be a problem. My first attempts were again to automate this, to make it easier. This, again, failed as to my knowledge Inventor doesn't expose the Derived part API either. The next step was maybe to create a manual version, only make the derived part manually once, and it updates.
This is when I discovered that the Derived part feature is highly unstable (at least in my experience). On large assemblies, it makes sense that this would take a while, but it crashes Inventor after a short wait. I experimented with smaller assemblies and it also seemed like these would crash quite easily. I had a small weld assembly with 3 parts, creating a derived part from this would cause Inventor to crash almost instantly. All 3 parts individually worked, but all 3 together crashed, I even tried to create a brand new regular assembly, placed the 3 parts in there, and it would still crash. After this I figured this method was too unstable for scaling larger assemblies, so I scrapped the idea.
- Import/Export STEP method. This is another thing I tried, by automating the importing/exporting process of a step file to a new part, I could create the reference assembly. Unfortunately all my attempts with this failed as well. Importing/Exporting with iLogic was, again, extremely difficult to automate. The furthest I got was an iLogic rule that could export the STEP file, create a new part and import the STEP file. This seemed good on the surface, but this would obviously break the link with the original. I figured if I could automate the export/import process (and it was fairly quick), you could just update the reference part every now and then. The problem was that my iLogic rule imported the STEP as lots of individual bodies, this meant that I now had a part file with 1177 solid bodies, obviously extremely laggy to scale, and takes extremely long to generate. My initial attempts were to import it as one solid, but these attempts also failed.
This is where I ran out of ideas, it's taken me about a week of trying many methods, and I'm still not much closer to a solution. My main problem was that I was kinda forced to use ChatGPT for writing the code, as I obviously can't write this myself that well as a beginner. Unfortunately, it would keep using outdated sources, and referencing features that didn't exist anymore. It couldn't find (neither could I) up to date, API documentation.
If anyone here has any more suggestions/fixes, I'm all ears.
Kind Regards,
Jeroen