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: 

Get sides of Cylinder Element

11 REPLIES 11
SOLVED
Reply
Message 1 of 12
Anonymous
1208 Views, 11 Replies

Get sides of Cylinder Element

Does anyone have ideas on specifying a particular side of a cylinder/element (attached pdf). I need to get the northern/top side in this view.

I know this could be done manually by picking one side or the other on the element, however I am attempting to this with no user input.  

I have attempted using the actual geometry class in hope of being able to cycle through the faces but since it is a cylinder I am only getting mesh objects which I am not entirely sure how to use in this way. Any ideas are much appreciated.

11 REPLIES 11
Message 2 of 12
jeremytammik
in reply to: Anonymous

Depending on how the cylinder has been constructed, the two sides you point out may actually belong to the same face. Therefore, there are possibly no two faces there at all. So, you will have to specify more exactly what you actually want to achieve. If you need a point on the north side of the cylinder face, you can calculate it by projecting a point lying further north down onto the cylinder face, for instance.

 



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

Message 3 of 12
Anonymous
in reply to: jeremytammik

Thanks Jeremy.

Unfortunately, I came to the same realization. Using a point that is just somewhere north of the pipe in the original pdf would work perfectly for that instance but it would not always be the case. I realize now I should have given some deeper context and thought out the question more thoroughly. To elaborate...

In general this is only needed in instances where the pipe is connecting into a elbow (as in the pdf). When it does so I need to get the side of the pipe that is on the corresponding longer radius side of the elbow it is connecting into. In case this is a little confusing I attached another pdf with misc examples. 

I suppose the real question I should have asked is how to get the longer radius side of a elbow fitting.

I have tried a few approaches thus far... first bounding boxes,  then connectors, and now geometry. But haven't yet yielded any consistent results due to the variably of the instances. Apologies for any confusion.

Message 4 of 12
jeremytammik
in reply to: Anonymous

Thank you for the clarification.

 

Oh, but that is pretty easy, though.

 

Of course there are innumerable ways to approach and solve it.

 

Here is the first that comes to mind:

 

The elbow has two connectors, and they each have a connection point and a direction pointing out of the elbow, say, `p`, `q`, `v` and `w`. These two points and vectors define two infinite lines. The two lines intersect somewhere, let's say in `r`. The intersection point is the same as the intersection point of the two connected pipes location lines, extended to meet. The outside edges of the two pipes lie on the 'outside' of `r`, where the 'inside' of `r` is defined as the part of the plane spanned by all positive linear combinations of `v` and `w`.

 

Sorry I have not spent more effort on putting this more concisely, but maybe you get the idea.

 

If not, say so, and I'll draw a little sketch to clarify what I am blabbering about.

 

 

 



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

Message 5 of 12
jeremytammik
in reply to: Anonymous

Here is the sketch, in case it helps:pipe_cylinder_sides_positive.png

Please excuse my poor digital drawing skills.

  



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

Message 6 of 12
Revitalizer
in reply to: jeremytammik

Make better drawings by using Revit 😉




Rudolf Honke
Software Developer
Mensch und Maschine





Message 7 of 12
jeremytammik
in reply to: Revitalizer

I'm afraid I seem to be sort of allergic to that kind of thing.

 

Problem is, I seem to be allergic to GUIs in general...

 

Nice new avatar picture you chose! Found the right question yet?

 



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

Message 8 of 12
Revitalizer
in reply to: jeremytammik

It's just my age.

 

Didn't find the answer yet.

 

By the way, "42" is just the rounded value.

In fact, the right value is "42.195" 🙂

 

http://www.marathon-kevelaer.de/index.php/en/informationen/faq/134-was-ist-der-sinn-des-lebens

 

Rudi




Rudolf Honke
Software Developer
Mensch und Maschine





Message 9 of 12
jeremytammik
in reply to: Revitalizer

I assumed 42 was the answer and the question yet to be determined...

 

https://en.wikipedia.org/wiki/Phrases_from_The_Hitchhiker%27s_Guide_to_the_Galaxy#Answer_to_the_Ulti...

 



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

Message 10 of 12
Revitalizer
in reply to: jeremytammik

I read the books many years ago, so I don't remember the details any more...

Getting older...

😞




Rudolf Honke
Software Developer
Mensch und Maschine





Message 11 of 12
Anonymous
in reply to: Anonymous

Once again thanks Jeremy!

I don't know how I overlooked the obvious. Tunnel vision I suppose. 

Message 12 of 12
jeremytammik
in reply to: Anonymous

Thank you for your appreciation.

 

My pleasure entirely.

 

Shared here for posterity by The Building Coder:

 

https://thebuildingcoder.typepad.com/blog/2019/09/extensible-storage-external-event-dll-and-pipe-fac...

 



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

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

Post to forums  

Rail Community


Autodesk Design & Make Report