Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Options

Passing configured dim from part to sub to full assembly?

Anne_NixonAnne_Nixon Member Posts: 4 PRO
Hi All, newbie here but I'm loving this platform. I'm trying to put a bunch of subassemblies in a line in an assembly and I want the space between them to be even despite their varied sizes so that they look nice and neat. The math is 1/2(width of part n + width of part n+1) = spacing. I have all my widths defined in a configuration table in the base parts. Is there a way to pass the width variable from the part to the mate definition in the assembly? I do this make a line of things task all the time, so it's not ideal to calculate the spacing by hand each time. 

Hope that was clear - I'm still getting the lingo down. TIA! 

Comments

  • Options
    Anne_NixonAnne_Nixon Member Posts: 4 PRO
    Sorry, I should clarify, that math gets you to spacing n, since the spacing will be different. I know how to make the space the same size all the time! :smiley:
  • Options
    romeograhamromeograham Member, csevp Posts: 657 PRO
    This is an interesting challenge. The way that you've written the math seems to require that part n knows what size part n+1 is. If you have a consistent arrangement of variably-sized parts in your assembly, this is probably workable. (You can Configure parts in an Assembly - and set the part's variables to be equal to a Assembly Variable - that you can set in the Assembly. There's a couple great videos in the Learning Center to get started: https://learn.onshape.com/catalog?query=configure assembly
    Onshape's got a super-powerful way of dealing with configured assemblies, that (magically) reaches in to the parts and drives configs.)

    To the equal-spaced parts (or subassemblies) that need to be in a row, a simple method could be to use Mate Connectors in the part studio to define the spacing. As the configured parts change size, their "spacing" Mate Connectors will adjust as well. In my simple example below, the MCs are just offset from the outer edges of the part.



    The variable #SPACE is used to set the offset from the edge of the part.  Note: the owner of the MC needs to be the part - the MC will exist everywhere the part does - making it available for mating in assemblies.

    The MCs move with the part's size:



    The #SPACE variable drives the offset of the MC from the parts - since the part sizes are configured, but #SPACE is not, the MCs are always the same distance from the side of the part.

    In the Assembly, the parts are daisy-chained together, creating Mates between MC "A" one one part, and MC "B" on its neighbor:


    This approach relies on mating the instances in the assembly in a certain order (unfortunately), but shoud be fairly robust to changes. As long as each subassembly's parts has the same MCs the mates should survive as the individual parts (or subassemblies) are changed.

    I think that the expression you proposed in the post would establish spacing between centers of parts, but without awareness of neighbor's width, I'm not sure how it would work.

    Hope this helps!
  • Options
    tim_hess427tim_hess427 Member Posts: 648 ✭✭✭✭
    @Anne_Nixon

    Just to clarify your initial request a little bit with an example:
    • Let's assume three sub-assemblies with widths equal to 1, 2 and 3. 
    • Spacing between 1 and 2 would be 1/2*(1+2) = 1.5
    • spacing between 2 and 3 would be 1/2*(2+3) = 2
    Is that correct?

    As @romeograham mentioned, there really isn't a way to pass variables up from a part or sub-assembly to a higher level assembly. What you could do, however, is use configuration variables in your top level assembly to drive both the sub-assembly configurations (ie width) as well as the spacing in the assembly. You'd need one assembly configuration variable to drive each of your sub-assemblies. So, if the number of sub-assemblies change, you'd need to add or remove your assembly configuration variables as well.

    Here's an example of driving things top-down. This would also work if the parts are replaced by configurable sub-assemblies. The width variables control the configuration of the parts. And the spacing formula is used in the mates to set the spacing. 

    Depending on how and when this will be updated (and how the documents will be used) making this work would require a good bit of setup. It would possibly be easier to just adjust the spacing manually. 
Sign In or Register to comment.