Message 1 of 8
Revit 2020 API BasePoint - Unable to access parameter info of linked models.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
We have been using a python script to get the BasePoint info from all linked models in a project. We use this to create a project dashboard showing all linked models and their associated location information. In 2020 this stopped working and I need to figure out a solution.
In the 2020 API we cannot access the Built in parameters for BasePoint when using GetLinkedDocument()
Is there another method to get this info from a linked model in the 2020API?
linkDocuments = []
for linkType in linkTypes:
if DB.RevitLinkType.IsLoaded(doc, linkType.Id):
linkDoc = None
for li in linkInstances:
if li.GetTypeId().IntegerValue == linkType.Id.IntegerValue:
linkDoc = li.GetLinkDocument()
if linkDoc is not None:
linkDocuments.append(linkDoc)
basepoints = DB.FilteredElementCollector(linkDoc)\
.OfClass(DB.BasePoint)
basePoint = None
surveyPoint = None
# print(modelName)
for e in basepoints:
if e.IsShared:
surveyPoint = e
break
for e in basepoints:
if not e.IsShared:
if e.get_Parameter(DB.BuiltInParameter.BASEPOINT_ANGLETON_PARAM) is not None:
basePoint = e
surveyPointNS, surveyPointEW, surveyPointElev = (
round(surveyPoint.get_Parameter(
DB.BuiltInParameter.BASEPOINT_NORTHSOUTH_PARAM).AsDouble(), 3),
round(surveyPoint.get_Parameter(
DB.BuiltInParameter.BASEPOINT_EASTWEST_PARAM).AsDouble(), 3),
round(surveyPoint.get_Parameter(
DB.BuiltInParameter.BASEPOINT_ELEVATION_PARAM).AsDouble(), 3)
)