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.

How do I place a Part at an arbitrary position inside an Assembly?

I'm facing an issue regarding Part placement inside an Assembly, and it really strikes me not to find the tools to overcome it.

I'm trying to place a Part relative to another one. This Part ishould be placed through a displacement (XYZ cartesian coordinates) and three rotations.

In other CAD softwares I would have simply created some guiding geometry inside the assembly as a reference for placing the Part. But in OnShape, Assemblies seem to be very limited in this regard. I cannot create sketches inside an Assembly, nor visualize sketches created in the Part Studio environment. There is no Transform tool either.

The next logical option was to use mates. I can create a mate from a reference entity and displace it in the XYZ directions. I can also perform one rotation. But the problem comes when I want to perform multiple rotations. I cannot find this option. 

So then a tried to place a second mate, taking the first one a created as the origin, in order to perform the second rotation I was seeking. To my surprise, I cannot use a mate as a reference for creating another mate. Which seems simply illogical. Why shouldn't I be able to use a mate as a reference frame when mates are, precisely, reference frames themselves?

I created an IR in order to set and get mates' relative positions.

https://forum.onshape.com/discussion/20536

Meanwhile, has anyone found a workaround to this?

Best Answers

  • eric_pestyeric_pesty Member Posts: 1,887 PRO
    Answer ✓
    Creating a mate connector offset using an other mate connector as a reference would be useful sometimes (also not sure why it's not allowed...).

    @javl0p_2, it's hard to tell what the best option might be without seeing exactly what you are trying to achieve but there are several ways to deal with what you are describing. 

    - You can use the triad manipulator to precisely more things around an assembly: relocate its origin and then with any drag/rotate you can type values, this is basically a transform tool and once you get it where you want you can use a group relation to lock them together.

    - You can also create a mate between the two parts with some offsets, and then edit each of the two mate connectors (expand the mate feature in the tree) to add additional offsets and rotations, it might take a couple iterations to get the result you want but that should allow any combination of offsets and rotations.

    - When dealing with weird geometry I typically prefer creating mate connector(s) in one or both of the parts to get the necessary reference(s) and then do a simple mate in the assembly.

    - You could also create a sketch (or sketches) in a part studio (including doing it in context with the first part if that helps) and then insert and mate the sketch(es) in the assembly to provide all references you might need.

    - You could also insert one or more "dummy" part (like a small surface or sketch, even using the "fake mate connector feature") and mate it with some of the offsets/rotations with the first part and then mate the second part to that with further offsets/rotations.
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    Answer ✓
    Ok, I finally manage to find a clean way to do what I want to do.

    I select my reference Part, edit in Context, then create the reference geometry and I create a Mate connector using base on that geometry. 

    Then i Insert and go to Assembly, where I can see and select the mate connector as a reference for placing my Standard Part.

    Thanks a lot for the help and advice!

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,688
    Mates are not, mate connectors are. You can use the triad to drag and rotate in 3 axes, but if you want it fixed at that location you could also use in-context editing and use the Part Studio transform tool. It does seem like an unusual request - can you share the doc and screenshots of what you are trying to do.
    Senior Director, Technical Services, EMEAI
  • eric_pestyeric_pesty Member Posts: 1,887 PRO
    Answer ✓
    Creating a mate connector offset using an other mate connector as a reference would be useful sometimes (also not sure why it's not allowed...).

    @javl0p_2, it's hard to tell what the best option might be without seeing exactly what you are trying to achieve but there are several ways to deal with what you are describing. 

    - You can use the triad manipulator to precisely more things around an assembly: relocate its origin and then with any drag/rotate you can type values, this is basically a transform tool and once you get it where you want you can use a group relation to lock them together.

    - You can also create a mate between the two parts with some offsets, and then edit each of the two mate connectors (expand the mate feature in the tree) to add additional offsets and rotations, it might take a couple iterations to get the result you want but that should allow any combination of offsets and rotations.

    - When dealing with weird geometry I typically prefer creating mate connector(s) in one or both of the parts to get the necessary reference(s) and then do a simple mate in the assembly.

    - You could also create a sketch (or sketches) in a part studio (including doing it in context with the first part if that helps) and then insert and mate the sketch(es) in the assembly to provide all references you might need.

    - You could also insert one or more "dummy" part (like a small surface or sketch, even using the "fake mate connector feature") and mate it with some of the offsets/rotations with the first part and then mate the second part to that with further offsets/rotations.
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    NeilCooke said:
    Mates are not, mate connectors are. You can use the triad to drag and rotate in 3 axes, but if you want it fixed at that location you could also use in-context editing and use the Part Studio transform tool. It does seem like an unusual request - can you share the doc and screenshots of what you are trying to do.
    I meant Mate Connectors, sorry for the confusion.

    I cannot share the document I'm working on due to company policy, but I can show an illustrative example. 

    Lets suposse I want to place a Standard Part (i.e. a DIN 912 screw) at a certain position relative to a Part 1, that I created.

    That position is defined by two angles, 30º and 120º. I create the geometry inside a Part Studio to illustrate this.


    The axis position of the Screw inside the Assembly would be defined by the line within the inclined angle. However, I cannot use Part Studio geometry within an Assembly to place my Standard Part.

    I can use a Fastened Mate but only set one of the angles. I can not achieve the second rotation.

    And yes, I could use the triad to get the second angle in place, but I can't do it in a parametric way. What if in the future I want to change this angle? There would be no reference dimension to do it. 

    Also, I don't think this request is that unusual. In a very early stage of design, it's common practice to place the commercial elements first inside an Assembly (at least the most relevant components such as motors, batteries, cameras...) and then create the Parts that serve as support structure or interface. In my case, the exact position of such elements is a design constrain I must comply with.
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    Creating a mate connector offset using an other mate connector as a reference would be useful sometimes (also not sure why it's not allowed...).

    @javl0p_2, it's hard to tell what the best option might be without seeing exactly what you are trying to achieve but there are several ways to deal with what you are describing. 

    - You can use the triad manipulator to precisely more things around an assembly: relocate its origin and then with any drag/rotate you can type values, this is basically a transform tool and once you get it where you want you can use a group relation to lock them together.

    - You can also create a mate between the two parts with some offsets, and then edit each of the two mate connectors (expand the mate feature in the tree) to add additional offsets and rotations, it might take a couple iterations to get the result you want but that should allow any combination of offsets and rotations.

    - When dealing with weird geometry I typically prefer creating mate connector(s) in one or both of the parts to get the necessary reference(s) and then do a simple mate in the assembly.

    - You could also create a sketch (or sketches) in a part studio (including doing it in context with the first part if that helps) and then insert and mate the sketch(es) in the assembly to provide all references you might need.

    - You could also insert one or more "dummy" part (like a small surface or sketch, even using the "fake mate connector feature") and mate it with some of the offsets/rotations with the first part and then mate the second part to that with further offsets/rotations.
    Thanks for pointing out so many options. I'll try to go one by one.

    - The triad manipulator works fine, the problem is I cannot use parametrically. Once the transformation is done, I cannot change the rotation or displacement in a parametric way.

    - I'm not sure I follow you with the mate connector solution. You mean creating a mate using two mate connectors and the editing both mate connector to get to the required position? I will give it a try but It seems a rather cumbersome workaround.

    - Creating geometry inside a Part Studio would be the cleanest way to achieve this. However, that only works If you are creating a second Part in the same Part Studio, not if you want to insert a Part inside an Assembly.

    - Since I'm working in Assembly, I cannot rely on FeatureScripts (not sure the reason why we can't access FS within an Assembly). I guess I could create extra Parts that serve as reference geometry, but it isn't ideal.

    Thanks!
  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,688
    You could insert the sketch you just created and assemble to that?
    Senior Director, Technical Services, EMEAI
  • dirk_van_der_vaartdirk_van_der_vaart Member Posts: 549 ✭✭✭
    edited March 2023
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    Ok, now I think this is what I'm looking for. 

    I can create a Part Studio in context to build the required reference geometry and then insert it directly into my Assembly. 

    However, whenever I click on Insert and go to Assembly, It won't let me select the sketches I just created. It should, since the Select Items to Insert window pops up and accepts parts/surfaces/sketches. However, it doesn't let me pick the sketch. Is that a bug or is it something I'm missing?

    Thanks for the pacience!
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    With Assembly Configuration this is peanuts, check the learning centre please.
    https://learn.onshape.com/catalog?labels=["Videos"]&values=["Configurations"]
    I'm sorry but I struggle to see how Assembly Configurations can help in here. Could you please elaborate? 
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    Answer ✓
    Ok, I finally manage to find a clean way to do what I want to do.

    I select my reference Part, edit in Context, then create the reference geometry and I create a Mate connector using base on that geometry. 

    Then i Insert and go to Assembly, where I can see and select the mate connector as a reference for placing my Standard Part.

    Thanks a lot for the help and advice!
  • a_ba_b Member Posts: 6
    Sorry to revive this old thread. I am currently working on a similar project where I need to perform 3 rotations (XYZ) parametrically on some assemblies. Do you have a new link to this example? The old one isn't loading for me. Thanks
  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    Hi, @a_b

    I have encountered the problem of performing consecutive transformations for assembly and part studio placing and this is how I resolved it.

    1. Create a Master Model Part Studio that you will use to place the key MC that will guide your assembly.
    2. Insert the whole Part Studio into your assembly, including MC.
    3. Inside the Part Studio, create a sketch composed of two perpendicular lines, representing the axis Z and X of your desired reference frame.
    4. Create a composite curve from this sketch. The reason is that you can't transform sketches, but can transform curves.
    5. Transform the composite curve that represents XY axes, once at a time. That is, either one translation or one rotation. One after the other. This way you could potentially have a full transformation (1 XYZ translation and 3 consecutive rotations)
    6. Use the reference composite curve to create a MC at the transformed pose.
    7. The transformed MC will appear in your assembly, where you will be able to use it as reference.

    I know this is kind of tricky, and would be much easier it you could use a MC as reference for another MC. Here is the corresponding IR in case you want to vote for it:

    https://forum.onshape.com/discussion/9877/mate-connector-definition-from-another-mate-connector

    If you want to perform a transform directly to a MC via traslation vector and rotation matrix, you can use the custom feature Get/Set Pose that I created a while ago:

    https://forum.onshape.com/discussion/21955/new-featurescript-get-pose#latest

  • a_ba_b Member Posts: 6
    edited June 26
    Thanks for taking the time to write that up. Sorry, I am  having a little trouble visualizing all of the steps. Do you have an example document by any chance?
    I was able to find the solution here: https://forum.onshape.com/discussion/comment/104322#Comment_104322

  • Javier_López_del_PueyoJavier_López_del_Pueyo Member Posts: 74 PRO
    I made a little example following the stepts above. 

    https://cad.onshape.com/documents/bc1fb0c811098f2433a4b5d3/w/15d257b38b39c4198efa6df9/e/efd7ebddf865b074a31e089a?renderMode=0&rightPanel=variableTablePanel&uiState=667bc5439542fa068cabfb18

    There you have a master Part Studio with a variable table that controls the transformation (translation and rotation) of a MC.

    When imported into the assembly, the MC comes along.
Sign In or Register to comment.