I want to apologize, it is a script and still in WIP, I started because sometimes I have parts in space and need to be orientated, so Iām trying to assembly as usually in other softwares, but Iām starting to learn python so I can tell you that my script is not professional.
I can share a part of it, at least it could serve to orient face of a part against face of other part. Hope it helps
Update2: clearer messages for target and reference, continuos option.
It works wonderfully! I see that the WIP version you shared has only 3 of the several options for orienting that you showed in your videos, but itās still quite usable. Thanks!
PS: I would just suggest to update the command prompts to each step so that they mention the words āreferenceā and ātargetā, in a similar fashion as the āAlign objectsā tool (I actually added your script as a RMB function to the latter). Currently, the command prompt says āSelect a flat surface to orientā for both, the reference and target faces. It would be easier to me to understand these if they were: āSelect a flat reference surface to orientā and āSelect a flat target faceā, respectively.
Thanks for your advice, as I understand how it works I forgot to give clear instructions, I will update it to make it easier to understand and I just found that the script can not be used 2 times the same option, so Iāll fix it too and update it.
Question, wich is the correct way to update it? Editing the comment where I uploaded it or a new comment with a new file.
(Already updated in the same last comment)
Yes, I have other options but Iām trying to figure it out how these should work. And I consider these 3 are used more often.
Also, I noticed that when using the āConcentricā option to orient cylinders and pipes, for example, the command prompt still asks to pick a flat surface. It could be replaced with context-based prompts such like āSelect a flat surface to orientā (or āSelect a cylindrical surface to orientā) and āSelect a flat target faceā (or āSelect a cylindrical target faceā) depending on whether the geometry to pick must be flat or cylindrical.
I tried it several more times with different kind of geometry and it works really nice every time.
You can upload a new WIP version in a newer post, because that will notify more people to come and check the topic, as well as will allow them to try the older version if they are curious to compare the changes.
The good thing about the āMatingā option is that it could also align the tangent of two cylinders. This is a very valuable option for engineering projects. Is there a way to be able to pick a specific point on both (with Osnap turned on), the reference surface and target surface?
Example: If I want to orient cylinder A next to cylinder B so that they share the picked points? Also, an option to pick the tangent seams of cylinders, in order to orient two cylinders with their seams touching together?
PS: I figured out that the orient will not work 100% of the time as expected. For example, if one cylinder is higher than another one and they both share the same orientation (like parallel top and bottom faces), the script canāt align them along their concentric body by picking their flat faces in a similar fashion like in Solidworks (1:30 minute of my video below). Of course, I donāt expect from a script to be as advanced as the mating engine of SW, though itās good enough for many applications even in its current WIP state.
I think that is possible, the 3 options current available in the script werenāt done aiming to cilindrical faces, thatās the reason I changed āconcentricā to āpoint coincidentā
I have an option that can align the axis of both cilinders, but trying to figure it out how should it work, your video helps me to understand, thanks.
Forgive me for my absence but my license ended and I had no way to check your script.
Although I did not test it on the normal project, my tests make me believe that this is the solution to my (and not only mine) problem. Now, I totally understand the joy of @kleerkoat@Rhino_Bulgaria and others.
I noticed that your tool gives more precision than the one from Revit. Looks like the program matches not only surfaces but the pick points as well.
I have two questions:
What is the difference between mating and orienting? I noticed that the latter places the object at some distance from the chosen plane.
Is it possible to create ālite versionā with only mating? I tried to edit the script myself but it didnāt work.
It would be good to skip two steps:
a. click on the script button
b. choose command ā can we skip this?
c. pick two planes
d. choose command again ā can we skip this?
Orienting. Is designed to orient a part almost in its own site.
Mating. Will orient and translate the part to make coincident the picked points, fast way, but without snapping.
Point coincident. This is orienting part and snapping position point to point.
at some point ,I will continue with carrot, to make it work better, by the moment, meet āBarleyā, āCornā, āRiceā , āOatsā, āRyeā etcā¦that are other scripts. These help me when, hole making, assign material, getting weight of parts and assemblies, Bill of materials etcā¦ These are oriented to tool and die and mold design.
Is there a way for mating of an entire group rather than a single object? When I run your script and try to mate a group of object to a target surface, only the surface I click first is being affected, whereas the remaining objects of the group stay unchanged.