Hello, I recently ran into an issue creating families on a face where I don’t understand what’s going on.
I’m trying to place families in a grid onto a surface.
For example, four instances at UV(10,10), UV(20,20), UV(30,30), UV(40,40)
_uv = new UV(10, 10);
location = face.Evaluate(_uv);
Document.Create.NewFamilyInstance(_reference,location , new XYZ(0, 0, 0), _symbol);
It works like i would expect.
when my Face is angled like this:
the panels will be placed like this:
The face evaluation returns XYZ Positions that aren’t on the face anymore. Even the origin changes.
Why does Revit calculate it like this? And how do I have to evaluate the correct XYZ on the angled Face, so I can create my families?
Solved! Go to Solution.
Solved by jeremy_tammik. Go to Solution.
Ours is not to reason why; ours is but to do or die...
Why Revit does this is not really helpful to know (we'll provide a hint below anyway).
How can this be handled? Now there is a useful question. In the distant past, Scott Conover explained the basics of the Revit geometry library, including face parametrisation:
https://thebuildingcoder.typepad.com/blog/2010/01/faces.html
You can never rely on the origin being in any specific location on a face. It depends on how the face was created. If the face is part of an element E, and you intersect E with another element F and subtract or join or otherwise modify the geometry, you might end up with new faces that have seemingly arbitrarily positioned origins.
So, when you meet a new face, you need to query it for its parametrisation. Where is your origin? Which direction are your U and V vectors pointing? How is you U and V scaling defined? Once you have determined all those factors, you can start calculating UV points and correlating them with real-world XYZ 3D locations.
Can't find what you're looking for? Ask the community or share your knowledge.