get position of linked project base point.

frederik_deketelaere4RFZQ
Explorer
Explorer

get position of linked project base point.

frederik_deketelaere4RFZQ
Explorer
Explorer
Hi all 
 
I want to get the project base point parameters (E/W, N/S and Elev) from a linked file. 
The Parametersmap seems te be empty. Can anyone help? 
 

 

#RVT links
rvt_links = FilteredElementCollector(doc).WhereElementIsNotElementType().OfClass(RevitLinkInstance).ToElements()
siteCategoryfilter = ElementCategoryFilter(BuiltInCategory.OST_ProjectBasePoint);
check_links = ""
coordinates = []
for rvt_link in rvt_links:
    active_doc = rvt_link.GetLinkDocument()

    if active_doc:
       

        siteElements = FilteredElementCollector(active_doc).WhereElementIsNotElementType().WherePasses(siteCategoryfilter).ToElements();
        positions = []

        for ele in siteElements:
            x = ele.ParametersMap.get_Item("E/W")

 

0 Likes
Reply
318 Views
4 Replies
Replies (4)

Niko_Davydov
Advocate
Advocate

Hi Frederik,

Have you tried using Revit Lookup? It could be helpful for you to uncover the parameter that you need.

 

0 Likes

frederik_deketelaere4RFZQ
Explorer
Explorer

Hey thanks. The funny thing is, when i select the project base point of the link, the LinkInstance is selected.

 

So the only option for me now is to load the linked file in another Revit and to execute the OST_ProjectBasePoint parameter in that newly opened file. 

Or find another way to find the position of the link. 

Any suggestions are welcome. Screenshot_3.jpg

0 Likes

frederik_deketelaere4RFZQ
Explorer
Explorer

I found another thing: 

It seems like the parameters ("E/W") in the Project Base Point of the link do not exist.
When i ran this code in the native doc:

 

for param in bp.Parameters:
        param_name = param.Definition.Name
        print("parameter", param_name)

 

I get these parameters:

('parameter', 'Angle to True North')
 
('parameter', 'Elev')
 
('parameter', 'E/W')
 
('parameter', 'N/S')
 
('parameter', 'Category')
 
('parameter', 'Category')
 
('parameter', 'Design Option')
 
('parameter', 'Family Name')
 
('parameter', 'Type Name')


When i ran the same code in the link i just got these parameters:
('parameter', 'Category')
 
('parameter', 'Category')
 
('parameter', 'Design Option')
 
('parameter', 'Family Name')
 
('parameter', 'Type Name')


Thus the only option is to run the links on another revit and perform the code there again. What a slow way of getting this information. Any other ideas are welcome!



0 Likes

antonbond
Contributor
Contributor

not sure if this helps, but from RevitLinkInstance you can get the link Document using GetLinkDocument(). After, you can retrieve ProjectLocations by Document.ProjectLocations following by projectLocation.GetProjectPosition(XYZ.Zero). You can then access required properties like EastWest, NorthSouth & Elevation.
See here

0 Likes