Get project or survey coordinates of structural column/ any element

Can Any body help me out with python script to get project or survey coordinates of structural column/ any element.

I am new to Python scripting. Guidance towards basics of what i should look at would be appriciated, Thank you,

Regards

You could do that with nodes.

A quick example…

 

This is with respect to survey base point.

Meaning , if i change my project base point these values wont change. Do they …?

 

Within revit columns can be a point or a curve, depending on if they are/not a slanted column(see below images).

If you get the solid centroid wouldn’t this Z value be half way up the element not the Z value that might be wanted if it is wanted.

To do this in python you would input the column elements into the python node then get its Location type, then do a filter between curve or point so you end up with two lists of elements depending on if they have a curve or a point.

For a curve you will then need to get both its start and end points. Once you have these points you should be able to get their point data and use the revit api transform command. This should then give you the world coordinates for that element.

You could extract Element.Curves (but they’re not always available by default)

The Start Point and End Point can then be extracted.

Hello Vikram,

Thank you for your response.

Here is what i am trying to do and stuck. Image below will help you understand my problem clearly.

Try using the Column family provided below.

Concrete-Rectangular-Column.rfa

20151228-2

Hi Vikram,

These coordinates are according to survey base point in revit.

When we change project base point to zero these point does not update/change according to project base point.

I hope you got what i am trying to explain , Image in the above comment explains it.

Thank you,

 

You could do so this way…

Hello Vikram, Thank you soo much. That one solved my problem. This is what i was trying to do .

 

dynamo

 

Can i get it much simpler .

May not be simpler, but a lot more compact with Design Script

Files:Columns.dyn, Columns.rvt

20151229-4

Thank you

How can i use method element.geometry in revit api in revit python shell ??? When i use that method the result return is not solid ??

selection = [ doc.GetElement( elId ) for elId in revit.<wbr />ActiveUIDocument.Selection.Get<wbr />ElementIds() ]
for i in selection:
print i.Geometry

result is : <indexer# object at 0x000000000000002B>

Interesting. Those points are relative to Survey Point or to Project Base Point?

Coordinates

I think it depend on when you set the family spot coordinate base on Project base point or Survey Point. In the picture, i’m sure you make 2 option for family spot coordinate, because you set project base point and survey point is (0,0,0) that mean they must have same place, right ??

Yes, two types. But what i mean is if those coordinates are realtive to (0,0,0) a “new origin” in the same way like Spot Coordinates does.

Sorry, my English sucks.

When i get location of element, then i move project base point and survey point and get location again.

Why both 2 case have same result ? Although The tag spot coordinate changed in right coordinate.

I agree. But when you get the location with Dynamo, that location is always realtive to (0,0,0). I want to get the location relative to Project Base Point, like the Spot Coordinates does; taking the Project Base Point like the origin. Something like this:

ProjectBasePoint

Yes, you right. I tested with my sample. The location properties of element return the position relative with Project location point when we start a project ( not Project base point) always is : (0,0,0).

If we want to get the location relative with survey point, we must transform origin point to survey point.

And if we want to get the location relative with project base point, we must make something like your code above : p.X - pbp.X

btw: in your code block, actually we don’t need check p.X with pbp.X which one bigger or smaller right ? just p.X - pbp.X to get the point relative with project base point.

Right, hahaha.

Thanks