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.

Cannot set primary instance

gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
edited October 2021 in Drawings
The doc about modeling in-context tells me how to set primary instance in an assembly:

Set primary instance
The primary instance is created when you edit a part in-context and is indicated by a solid arrow beside the feature in the Feature list (in the Part Studio) and beside the part in the Instance list (in the Assembly). The primary instance defines the anchor part (the part selected for the Edit in context command) for the placement of the ghosted assembly in the Part Studio; all other assembly components appear in the Part Studio in relationship to that primary instance.
You have the ability to change the primary instance of a Context at any time and may wish to do so especially in the case of a broken or missing primary instance:
  1. In the Assembly, select a part.
  1. Right-click to access the menu, and select <context name> > Set as primary instance.

In my assembly, selecting a part, right-clicking shows a menu, but no <context name>. Has this changed? Does the documentation need an update?



The workflow I came up with (this is probably where the problem is, not thought to be used that way): I created the yellow part in a part studio. The grey part in another. Now I want to "free place" them in an assembly, because it's much more convenient than in a part studio. Last, I did "Create Part Studio in Context", and I want to do the actual merging of parts in that new Part Studio.

But there, I get the infamous "No Primary Instance", which I was hoping to give in the assembly, as per the doc.

What should I do?

Comments

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
    First you will need to create a context,

    if you select "edit in context" from that menu you show, then it will create a new context and set that part as the primary instance.

    the only time you need to manually set the primary instance is when the in-context reference is lost. Like if you make a new part in context but don't insert it right away.
  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    @john_mcclary So I did "Create Part Studio in Context". This creates a context, right?

    In the new Part Studio I did a "Transform -> Copy in place" of the two parts in the context. 

    Now I've updated the assembly, so the context. I'd like to update the context in the new Part Studio.

    if you select "edit in context" from that menu you show, then it will create a new context and set that part as the primary instance.
    But I don't want to create a new Part Studio every time I modify the assembly. I understand this may not be what you were suggesting.

     Like if you make a new part in context but don't insert it right away.
    Do you mean that I should insert the merged part from my new Part Studio, into the assembly?
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
    There are two ways to begin editing incontext.

    One is to click on the 'create partstudio incontext' button in the assembly. 
    That will create a new partstudio which you can create a new part. 

    If you just want to add contextual related features to an existing part. Right click the part and start editing. You can also double click the part in the tree. 

    Normally you won't need to worry about manually setting 'set primary instace' that tool is for allowing you to set an instance later on incase something happens. For example, you may delete the original primary instance in the assembly later in design. So you would then need to set a new primary instance Only if you keep adding more incontext relations, or if you need to reattach some broken ones. 
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    One is to click on the 'create partstudio incontext' button in the assembly. 
    That will create a new partstudio which you can create a new part. 

    That's what I'm trying to do, but it won't let me update the context in the Part Studio. Do you mean that there should be a primary instance already, but somehow I've lost it? And apparently cannot give a new one with the context menu?

  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
    when creating a new part using the create part studio in context method.

    you will need to insert your part from the insert and go to assembly option.



    then choose your parts to insert


    here you can see the part automatically become the primary instance because the arrow icon is solid black


    if you instead just insert the part after the fact


    then you will see the part has context, but there is no part that is a primary instance, so there is no reference point for incontext to begin.
    So we set one part as the primary instance, and also selecting which context we are setting the primary instance (only one to choose from this time)
    (I also inserted a few more copies here so you can see the difference)


    now let's slide the thin block away from the large block, my incontext relation started on that corner point being coincident.


    now when i update the context, you can see everything works again





    So again, you should only need to "set primary instance" if you mess something up
  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    edited October 2021
    Ok, I think you got it:

    you will need to insert your part from the insert and go to assembly option.

    I never did that, or intend to. The workflow I was interested in is:
    1. assembly, moving things around
    2. create a new (merging) Part Studio in context (copying in place the parts from the context, and continue working from there).
    3. never place the new part into the assembly (it'd collide with the already existing assembly parts anyway)
    4. make placement changes in the assembly, and update the context accordingly in the merging Part Studio
    That is not possible, I cannot update (without inserting the part back to the Assembly, you say). From a user perspective, I don't think it makes sense. Maybe from an implementer's point of view.

    But the additional thing is that the documentation says I should be able to manually set the primary instance, if something went wrong. I can't even seem to be able to do that.

    So thanks to your help I have a work-around: insert the part back to the assembly, and hide it. I just verified it works, so thank you! I'll still claim it's a weird step :) Or it's my use of assemblies that is weird. All of this would have been avoided if the Part Studio "Transform" operation had a mode that allowed for translation and rotation together, the same way it works in assemblies.
  • john_mcclaryjohn_mcclary Member, Developers Posts: 3,890 PRO
    You can transform by mate connectors in a partstudio. 

    Incontext is for bringing information in an assembly into a partstudio. So if you don't need an assembly then you should probably use derive and transform instead. 

    I think you are creating a lot of extra work with the incontext workflow you suggest 
  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    edited October 2021
    @john_mcclary I understand. I've attempted to do it without assembly again. The fact that transform separates rotation and translation is really a pain. To do what I want, I need a transform to roughly translate in position, so that I could see how much I should rotate (1 axis at a time, and requiring pointing at which axes, so up to three Transforms for each rotation axes), so that I could finely translate again.

    I also tried to just modify one of the parts in the assembly, from its existing Part Studio, and that went smoother. Still some weirdness, having double parts (the original, and a copy from assembly).

    I have another simpler example, I think it shows how the features of Assembly really are helpful in Part Studios. My mind still feels there something awkward. I posted it as another question since although it's related, it's really another model and I want to limit confusion.

    Here is the new question, with a link to an OnShape document, I hope it helps focusing on the workflow I'm trying to do, and what I should do instead.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    @gauthier_östervall

    Hang in there, the assemblies in OS are very good and take time to understand. In OS you can build sub-assemblies that'll work in higher level assemblies, a library assembly that'll work when inserted into another assembly. With this comes some differences that'll you'll have to understand.

    No system will allow you to mix rotates & translates. Rotates are procedural and have to be done in a sequence, it's math, nothing to do with CAD. 90% of the time, when using transformations, I'm using mate connectors.





  • gauthier_östervallgauthier_östervall Member Posts: 99 ✭✭
    @billy2 Yes I really like the power of the assemblies, which is why I wanted to use them to work for me :)

    In assembly, the move handle both has translation and rotation. If it's possible to do in assembly, why not in part studio?

    I'm a big fan of mate connectors too, the thing is when I want to "free hand" their position. I need to create a plan, then a sketch, then place a dot or line in the sketch, make sure I have a direction line, then create my mate connector and direct it. After that I can:
    1. move my part to the connector, and 
    2. "oh, a little to the left", 
    3. open the sketch (which is before the Transform, so the part is not there anymore),
    4. move the dot a little to the left, not seeing the result until I
    5. exit the sketch
    6. "oh, that was too much", go to 3... unless it's the plan I need to move, and then maybe I need to move yet another dot in another plane, to move the first plan, ...
    That's how I'm doing it in this other design I was doing today, but comparing it to moving parts around until it looks right in an assembly, it is such a hassle!

    Regardless, I don't understand why a user shouldn't be able to:
    1. create an assembly
    2. create a new part studio in context
    3. modify the context
    4. update the context in the part studio, without inserting back the part to the assembly
    These are the steps that give me "No primary instance", but no way to define it (besides inserting the part in assembly, which results in double instances of parts. Maybe that's what I should live with).
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited October 2021
    @gauthier_östervall

    Why is there one tab that can build an assembly & another a part studio?

    Math

    Parametric modelling is 34 years old and we've always had assemblies & parts. Each of these are so different mathematically that combining them would have taken a long time to develop. It's an easy question to ask, but, a tough thing to solve.

    I'm of the opinion that my deliverable is always an assembly and the part studio just creates geometry for my assemblies.

    Remember that CAD is a representation of old manufacturing processes and when you consider product life cycle, it's best to have assemblies & parts. I know when you're starting out it seems overwhelming and burdensome. After releasing a product into the wild, it becomes more obvious what we're trying to achieve with CAD.

    I'm not going to defend "Primary Instance", I don't think it's necessary. I won't defend "In-context" either. If you look at the history of parametric feature based modeling, In-context is a bolt to the whole math structure and causes a lot of grief for learning & manufacturing. The whole discussion about "top down" and "bottom up" is silly. All the designs are top down. Bottom up is talked about because the CAD math works that way. The CAD guys would love us engineers to accept the bottom up design approach. How can you design a bunch of parts and expect them to work in an assembly? The fact that you can design in an assembly is "In context" and it's kinda screwy.

     Don't blame OS, all parametric modelers solve the problem the same way. OS is pushing the paradigm forward and is a great place to hang out.

    Also, these are my opinions,




Sign In or Register to comment.