Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to understand the BoundingBoxUV of face

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
1120415118
1217 Views, 2 Replies

How to understand the BoundingBoxUV of face

Hi all!

I am recently doing something with AVF, and have some problems with the BoundingBoxUV of face. I use following codes to achieve the feature points of the bottom-left corner area of the face,  but the result shows that the feature points refer to the upper-right corner area.

Snipaste_2020-03-12_22-55-34.png

 BoundingBoxUV boundingBoxUV = face.GetBoundingBox();
UV min = boundingBoxUV.Min;
double midU = (boundingBoxUV.Max.U + boundingBoxUV.Min.U) / 2;
double midV = (boundingBoxUV.Max.V + boundingBoxUV.Min.V) / 2;
UV mid = new UV(midU, midV);

 

I'm confused about this result! anyone can help me? Thanks in advance!

 

 

2 REPLIES 2
Message 2 of 3
jeremytammik
in reply to: 1120415118

You need to know in which XYZ direction in 3D space the UV vector components U and V are pointing.

 

You can find out by projecting a XYZ point onto the face surface and seeing where it ends up:

 

https://www.revitapidocs.com/2020/802cc09b-d0a4-dfc5-8ca1-e8c5e8cd4ced.htm

 

  public void Project(
    XYZ point,
    out UV uv,
    out double distance
  );

 

There is probably some more direct way to query either the face or its underlying surface for the U and V directions in 3D space.

 

Please find out and let us know.

 

Thank you!

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 3
1120415118
in reply to: jeremytammik

Thanks for your replay, Jeremy Tammik.

Forgive my stupidity, I don't understand your method, but it inspired me to think of another way. I use Dynamo to query the U and V directions of the face, and I am glad to share it.

Snipaste_2020-03-13_12-51-08.png

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report