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 position of linked project base point.

4 REPLIES 4
Reply
Message 1 of 5
frederik_deketelaere4RFZQ
236 Views, 4 Replies

get position of linked project base point.

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")

 

Labels (3)
4 REPLIES 4
Message 2 of 5

Hi Frederik,

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

 

Message 3 of 5

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

Message 4 of 5

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!



Message 5 of 5

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

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

Post to forums  

Forma Design Contest


Rail Community