Dimension Circular Faces through API

Dimension Circular Faces through API

guflerZD74K
Contributor Contributor
534 Views
4 Replies
Message 1 of 5

Dimension Circular Faces through API

guflerZD74K
Contributor
Contributor

Hi everyone,

 

I need to automatically generate a simple dimension for a structural floor with a circular cutout. The result should look similar to the one in the attachment, which I created manually using Revits UI.

 

So far I found out that I cannot directly use the references of the circular faces, since this will get me random results.

Instead I have to use the references of the edges inside the EdgeLoops property.

 

However, this also seems to work only half of the time (see attachment).

 

Does anyone have an idea why this works using Revits UI but not through its API? Do I make false assumptions somewhere?

 

 

Below is the debug view of my algorithm to see what I am trying to achieve.

 

Dimension Algorithm Debug View.png

 

0 Likes
535 Views
4 Replies
Replies (4)
Message 2 of 5

jeremy_tammik
Alumni
Alumni

I recently described my own related experiences:

  

https://thebuildingcoder.typepad.com/blog/2023/06/unit-testing-and-arc-dimensioning.html#4

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 3 of 5

guflerZD74K
Contributor
Contributor

Hi Jeremy, thanks for your quick reply. This seems to be exactly what I am searching for 👌.

 

I will test it and let you know how it worked out.

0 Likes
Message 4 of 5

ctm_mka
Collaborator
Collaborator

A thought, assuming a single circular cutout per your example, it may or may not be "easier" to grab the first arc segment from the edge array, rather than parse through the face array, and use the centerpoint and radius to calculate your four points.

0 Likes
Message 5 of 5

guflerZD74K
Contributor
Contributor

Late update:

 

Trying Jeremy's approach (and others) I am getting all kinds of results, of which none seems to be "universally correct".

 

I utimately settled for generating DetailLines for complex geometry (anything that is not a PlanarFace or an Edge line) and dimensioning them instead. Although this comes with several downsides (reference does not move with geometry, DetailLine has to be visible) it works great for now!

0 Likes