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.

Newbie question: How can I center 2 parts in an Assembly ... at a fixed offset distance?

john_smith077john_smith077 Member Posts: 175 ✭✭✭
edited March 2022 in Using Onshape

Hello

1. How can I align the centers of Part A and Part B in the X dimension?

2. How can I fix the sparation distance between the two edges to a specific distance? (e.g. 2mm)

Note: I have applied a Planar Mate to the back face of Part A and Part B.

Background
Part of my problem is that I have two 45 degree chamfers facing each other, rather than two parallel faces... 
 
Many thanks

J



PS My apologies for the novice question, but I am stuck!

PPS Is there any way to insert an image into these forum posts without them going full-width?

Comments

  • POCPOC Member Posts: 26 PRO
    Add a mate connector to the edge of the chamfers, then use fastened mate with offsets.
  • john_smith077john_smith077 Member Posts: 175 ✭✭✭
    POC said:
    Add a mate connector to the edge of the chamfers, then use fastened mate with offsets.
    Yes, that seems to have worked. Many thanks!
  • john_smith077john_smith077 Member Posts: 175 ✭✭✭
    edited March 2022
    PS It is possible to use a Variable for the Offset value?
    If so how do you set it up? 

    In truth I would like a to be able to set up a global set of variables that I can use in any Part Studio, as well as in any Assembly.

    [Should I enter this as a separate question?]

    J

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,959 PRO
    edited March 2022
    Use a fastened mate on an edge, the Z-axis will be in-line with the edge (for centering)

    Then edit the offset as needed


    *Edit* Opps I see this was answered while I was answering too :)
  • john_smith077john_smith077 Member Posts: 175 ✭✭✭
    Thanks John. Any thoughts about Variables? (see my last reply)
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,959 PRO
    edited March 2022
    There are no variables in assemblies 'yet' comming soon though. 

    So instead you would add a mate connector in the partstudio and use your variable defined offset there. Then fasten it in the assembly

    They didn't say when grobal variables will be coming out. But they showed off a demo at the live event. They talked like it could be any update now. 
  • christian_pettychristian_petty Member Posts: 79 PRO
    You could use configurations to switch between different offsets.
    Christian Petty - Mechanical Design Engineer, Radian R&D
  • john_smith077john_smith077 Member Posts: 175 ✭✭✭
    OK that works. Thanks!

    So to get clear, as things stand there is no way to even share a master set of Variables between different Part Studios, yes?

    J
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,959 PRO
    You can in partsudios

    there are a few methods, but the simplest one would be to use the "superderive" featurescript and check the "import variables" option.
    You will need to import at least one object from the partsudio. If you only want the variables, then create blank sketch or a plane to import.

    SuperDerive | SuperDerive (onshape.com)

    this is something I do often in Onshape, and it works great.
    You can see how many variables I'm using by the size of the scroll bar :)





    Import in partstudios is very inefficient though. since it needs to load the entire partstudio each update.

    but if you create one 'master variable partstudio' with only a single importable feature (like a sketch) then it will speed things up.

    But like I said, this will all be obsolete once global variables comes out. Hopefully in the next month or two? ? ?
  • dirk_van_der_vaartdirk_van_der_vaart Member Posts: 560 ✭✭✭
    How about designing all 3 parts in 1 Partstudio and then use configurations for everything you want to vary.
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,959 PRO
    This is for when the partstudio gets too large.
    My first chute in Onshape for example had roading times of minuets after every feature edit. 

    Breaking it up into 4 partstudios reduced it to a second or two. 
    You need to find the best approach per design. One partstudio only really works for very small designs. 
  • glen_dewsburyglen_dewsbury Member Posts: 1,124 PRO
    That looks like it can be done with an offset fastened mate.

  • bernard_hymmenbernard_hymmen Member Posts: 7

    I had a situation where I had a number of items with planar faces, some of which were at odd angles and orientations. My challenge was to position new items in an assembly at the one place where the new item's face A was a fixed distance from one existing face, face B was a fixed distance from another existing face, and face C, a fixed distance from a third.

    A planar constraint with an input for an offset distance would have been exactly perfect for this. But since that doesn't seem to exist, I created a part studio called "Spacer Block" that was just a simple cube with a configuration table that set the size of the cube to various dimensions that were important to my design. When I needed to put a new item into my assembly I threw in a couple of appropriately sized spacer blocks along with it and then set planar constraints on those for both the new item and the existing assembly. Once new item was correctly positioned in the assembly, I just turned off the visibility of the spacers.

    In my case, I didn't need to worry about gross properties of the overall assembly, like volume or center of mass, that could have been messed up by the spacer blocks, so this little hacky approach worked pretty well for me.

  • eric_pestyeric_pesty Member Posts: 2,296 PRO

    @bernard_hymmen, not sure what you mean by

    "A planar constraint with an input for an offset distance would have been exactly perfect for this. But since that doesn't seem to exist,…"

    You can definitely offset mates (in the mate dialogue itself as well as by editing the mate connector themselves)…
    You can also use parallel mates with limits so it seems like you made your life a lot harder than it had to be…

  • bernard_hymmenbernard_hymmen Member Posts: 7

    @eric_pesty, I'll clarify: I meant that I didn't understand the options in the planar constraint dialog (tragically misinterpreted the axes) and so put together a tedious but effective workaround to compensate for my lack of understanding. D'OH! Thanks for the jolt of reality! Much appreciated.

Sign In or Register to comment.