Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Reset part instance to default position in assembly
johan_van_ravenhorst
Member Posts: 19 ✭✭✭
Introduction
Inserting a part in an assembly offers a "default positioning" as specified in [1]. This uses the orientation and position of the the part w.r.t. the part studio's coordinate system *as* the orientation and position of the part instance w.r.t. the assembly's coordinate system.
Problem
Is it possible to "reset" the position of a part instance in an assembly back to this default after editing?
Motivation
Such a reset is useful if [edit: for example] all of the following conditions are met:
Please help. Maybe I am missing something, or this problem is the consequence of bad modeling habits (not uncommon for me), or maybe an improvement request can be based on this discussion.
References
[1] https://cad.onshape.com/help/Content/insertpartorassembly.htm?Highlight=assemblies
Inserting a part in an assembly offers a "default positioning" as specified in [1]. This uses the orientation and position of the the part w.r.t. the part studio's coordinate system *as* the orientation and position of the part instance w.r.t. the assembly's coordinate system.
Problem
Is it possible to "reset" the position of a part instance in an assembly back to this default after editing?
Motivation
Such a reset is useful if [edit: for example] all of the following conditions are met:
- a large number of parts has been created in a single part studio P (e.g. due to many dimensional inter-dependencies),
- in assembly A, these parts must keep the same position and orientation w.r.t. each other as defined in P using a "Group",
- in A, many part instances from P have mates with parts from part studios *other* than P,
- for some reason, many P-parts have moved away from their initial default position (e.g. due to unintended manual movement, propagated updates from edits in P, etc) [edit: also assume many arbitrary movements of the P-part instances w.r.t. to each other]
- it is too much work to use the triad manipulator (or [temporary] mates) to bring the many part instances to the desired relative position to be used for the Group.
- "Replace parts...": Does not work because it uses the "current" part position instead of the "default".
- Ctrl-z: Already too late for that.
- re-inserting parts using default positioning: This would require replacing many mates.
Please help. Maybe I am missing something, or this problem is the consequence of bad modeling habits (not uncommon for me), or maybe an improvement request can be based on this discussion.
References
[1] https://cad.onshape.com/help/Content/insertpartorassembly.htm?Highlight=assemblies
Tagged:
1
Comments
Is this worth an improvement request?
Thinking out loud: Could such functionality be added, using Featurescript? For each user-selected part instance in the assembly, the script can query the position and orientation in the part studio (in which the part was created) and copy those values to the position and orientation of the instance in the Assembly. So there would be no need to save the initial position and orientation of the part instance in the assembly.
FeatureScript is only for Part Studios. However if you fancy having a go at REST API, you can transform all your parts in one go. Good luck!
Owen.
HWM-Water Ltd
HWM-Water Ltd
https://cad.onshape.com/documents/7a2aca223858e21747087f1c/w/7820e1a4953125baa4dbcd89/e/815a8f1522996a1d5d318bad
Rather than using a mate connector, I'll quite regularly use a dummy part which is re-inserted in the modeled position (default), fix it and fasten mate the existing out of position part to the dummy moving it back to the modeled position, then delete the dummy and the fasten mate and re-add a fix or group mate. A simple move part to modeled position(default position) would be much easier.
Twitter: @onshapetricks & @babart1977
@brucebartlett: Nice workaround, thanks.
Just wondering, should setExternalDisambiguation be done before a feature uses the id, or can it be done any time?
In your FS, it has setExternalDisambiguation afterwards.
IR for AS/NZS 1100
I've actually made a mistake here, thanks for pointing it out. The intention of setExternalDisambiguation is to help in the historical processing of operations with an unstableIdComponent. Since historical processing is the final step of the opXYZ(...) call, setting the external disambiguation after calling the operation will actually have no effect. I've updated the script.
I also just noticed that I never versioned the document. Now it is versioned so that anyone can use the feature directly from the document, without making a copy.
I somehow missed this when you tagged me in March. Just came across this FS now. Thanks for this!
There is no way to explain this easily.
How can you add components to a sub-assembly and then have them appear correctly in a higher level assy? I think I'm doing this, but struggle explaining it.
I have a group, that's suppressed, defined in a sub-assembly. The problem is when you add new components at this level, they don't appear in the top assembly correctly because you've moved that sub-assembly in the top assembly.
To get around this,
-I position all the components correctly in the sub-assembly
-un-suppress a group thats used for this purpose and add all components to group. This causes all the mates in the sub-assy to error out, who cares it's only temporary.
-go to the top level, and the sub-assy group forces everything together correctly.
-go back to the sub-assy and suppress the group, everything calms down.
-go to the top level, parts are now in their correct position.
I can do this quickly and find it's a great way to keep top level assemblies in-sync with lower level assemblies.
I have yet figured out a way to explain it though, I suppose you can tell from this post.