Sub-Assemblies within a top Assembly and retain size changes

Sub-Assemblies within a top Assembly and retain size changes

drileyPJ9YZ
Contributor Contributor
227 Views
4 Replies
Message 1 of 5

Sub-Assemblies within a top Assembly and retain size changes

drileyPJ9YZ
Contributor
Contributor

I have a rule and a form that changes the size of our cabinets as needed to quickly produce drawings for cutting tickets for the shop. What I want to be able to do is use that same style of cabinet (base, upper, etc.) in a what can be called a Main or Top Assembly with several different sized cabinets within the same run of cabinets but those same style cabinets may be different sizes. The issue is when lets say a 302-Upper Cabinet is places in this run but say we need one 30" wide, another 36" wide and yet another 28" wide. When placed in the run they all will come in at one size and if I want let's say the 28" to be 28" and I change that through the form they all turn to 28" instead of retaining 30" or 36". How do I differentiate this within code for the same style of cabinet but maintaining the different sizes and not have all of them change to one size within that run? 

 

I'm not sure what files I need to provide to receive help but will provide whatever is needed when someone replies.

 

Curtis Waguespack is helping but I know he's very busy teaching classes most days and I'm sure he gets inundated with questions and requests for help so I thought I would throw this out here for help from the whole community. Maybe someone has ran into this problem already and can provide an answer or help.

 

Thank you.

0 Likes
228 Views
4 Replies
Replies (4)
Message 2 of 5

WCrihfield
Mentor
Mentor

Have you considered using ModelStates yet?  Each of the 'main' assembly's component occurrences that represents a different 'cabinet', can be set to a specific ModelState that was defined in that referenced document, where each ModelState represents a different configuration/size of the cabinet.  In a case like that, there could be just one source file being referenced by all of those occurrences, but each occurrence can be set to whatever ModelState version of that model that you need it to be.  So, within that model, create a different ModelState for each size &/or variation of configuration, sort of like an iPart or iAssembly, but all contained in one file.  When set up that way, that can mean multiple 'Documents' per one 'File', so automating it by code may get more complicated.  Just one idea that came to mind.  But I have no idea how all of your stuff has been set-up / designed so far, so not sure if this would work for you.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 5

ryan.rittenhouse
Advocate
Advocate

We had to solve a similar problem with tread assemblies on our engineered staircases. A lot of the treads were repeated, but many were individually customized or different sizes, but they all start from the same assembly and parts. The way we solved it can get complex, but has worked very well for us - your mileage may vary

 

When we place the customizable sub-assemblies, they are a read only assembly in our vault that we use as the master copy. We wrote a function call Localize that copies a given component occurrence to the the same folder as the main assembly and names it with a given "baseName". If two occurrences are given the same base name, we use the already created assembly and they are identical. This lets us minimize the number of distinct subassemblies we have while still allowing them to be different as needed.

 

The process of the Localize Sub goes something like this:

 

- Sanity check inputs! Make sure the comp isn't suppress and the baseName is not null

- Create the fileName for the localized comp: we use some parameters inside and some other data, but you could just use the baseName and add ".iam" if you want

-Check if the fileName exists already. If it does, do a comp.Replace with the fileName and exit

-Copy the fileName of the given component to the new fileName

-Do a comp.Replace(fileName, False) on the component

-We kick an updated rule in the subassembly at this point to localize the parts that are custom in the now-custom subassembly, but you could just as easily do this somewhere else

 

I'm happy to clarify if that's not specific enough. If you'd like to see our code, I can send it to you, but be warned, it's very customized to our use case. Hope this helps

If this solved your problem, or answered your question, please click Accept Solution.
Message 4 of 5

Curtis_Waguespack
Consultant
Consultant

@drileyPJ9YZ , I attempted to send this example on Wednesday via email, but maybe it didn't go through?

 

In any case, see the attached *.zip file containing some Inventor 2025 files. 
 
This is just a small cabinet layout project that I had on hand, it's just a happy coincident that it happens to be cabinets. 
 
It is just a very simple data set and not very realistic. But demonstrates how to place different size components using the same base templates. Note in this example we're only setting the width and no other dimensions such as depth or height. Also this example is just using the cabinets modeled as parts for simplicity.
 
Here's a very brief video explainer of these files.
( please excuse the cat, as soon as he heard me speaking, he thought he was missing out on something and had to be nosy and try to be part of the video. 🐱 )
 
Let me know if this data set doesn't work for you for some reason or doesn't help, and I'd be happy to have a look at your files.

 

EESignature

0 Likes
Message 5 of 5

Curtis_Waguespack
Consultant
Consultant

Hey @drileyPJ9YZ ,

A quick update to my previous post.

Maybe the jump from just using simple parts like my first example, to subassemblies is a bit much, so here is an updated example using cabinet units as subassemblies, which is more in line with what you are working with. 

...attachments/autodesk/120/177220/1/Cabninet%20Subassembly%20Example%202025.zip

 

This example keeps it pretty simple in that the subassembly only has 2 part files, but it should serve as an example of one way to do this.

 

(If getting the concepts in this example married up to your real world files is still a big leap, I understand. Feel free to reach out to me and we can take a call next week.)

 

Here's a quick video explainer ( no cat interruption in this one 🙃 )

 

 

 

EESignature

0 Likes