Automating scaling assemblies to prepare for 3D printing

Automating scaling assemblies to prepare for 3D printing

jeroenvanloonBU8CV
Observer Observer
101 Views
6 Replies
Message 1 of 7

Automating scaling assemblies to prepare for 3D printing

jeroenvanloonBU8CV
Observer
Observer

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

0 Likes
102 Views
6 Replies
Replies (6)
Message 2 of 7

jeroenvanloonBU8CV
Observer
Observer

@CGBenner I noticed you moved my original post, sorry for posting it in the wrong thread. I noticed this earlier as well, so I reposted the same one on this thread. I don't think I can delete my post, so could you remove this one, to avoid duplicates?

0 Likes
Message 3 of 7

CGBenner
Community Manager
Community Manager

@jeroenvanloonBU8CV 

Yes, no worries!  Sometimes it can be a very confusing structure for new users.  I will clean it up.  

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!


Chris Benner
Community Manager

Message 4 of 7

catBUN5M
Enthusiast
Enthusiast

I guess it depends on the complexity of the assembly and the required modifications. Like your first point I would start with derive of the assembly into a part file while keeping each part as a solid body, then do the adjustments in that part file (delete face, move bodies, combine, thicken etc.). But I do not know how the performance will be for large assemblies, but maybe dividing it into smaller chunks is an option. If you need to go the "Make Components" route afterwards to recreate it as an assembly again, then all the resulting parts should become grounded and will keep their position as per the derived part file.

You can then do the scaling directly in the Derive command or the Make Components command (before or after the modifications).

As for the API documentation; it's all online, just press F1 in Inventor and you can browse the documentation for the API and the iLogic API. Here's sample for derive: https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DerivedAssemblyComponents_Add_Sample

 

0 Likes
Message 5 of 7

hollypapp65
Advocate
Advocate

What are you scaling down?  A desk, a car, a building, a city, solar system, galaxy?

Derived should be the best with simplify.  Derived an assembly into a part and start there.  Use simplify to remove internal voids, small hole, thin wall etc.

0 Likes
Message 6 of 7

jeroenvanloonBU8CV
Observer
Observer

Currently I've been avoiding the derive command on purpose, as (to me) it's not just unstable with large assemblies, but also unstable with smaller ones. I've tried to create a derived part of a large assembly and after some loading time, the program crashes. I then tried a very small weldment assembly (part of that larger one) and it instantly crashes. If I create a derived part of each of the 3 components individually, it's fine. I even created an entirely new regular assembly, added the 3 parts in (not even constraints) and the program crashes as well. These parts are not complicated. I figured if the derive feature is this unstable, with some parts seemingly randomly causing crashes, I'd better avoid it.
The complexity of the things I'm scaling also really depends on the project, the firm I work for creates custom solutions for various other firms. This can be something like a simple bending tool for high-gauge cable (think maybe 20-30 solid bodies) or a part of a large industrial production line with maybe 1000 solid bodies.

0 Likes
Message 7 of 7

jeroenvanloonBU8CV
Observer
Observer

The project scale depends a lot, I'm working for an engineering firm that creates custom solutions for various partners and sectors. It might be a simple bending tool for high gauge wire for the electricity company containing maybe 20 bodies. Or it might be a part of a large industrial manufacturing plant, being a custom belt assembly with maybe 1000 bodies.
Personally, the workflow that I'm developing should be quite robust, so I'd like it to work on both larger and smaller assemblies.

0 Likes