Hey there,
I see in your code that your converting the units of the points you get from the rooms, but I don’t think that transforms the locations to the correct coordinate system. I believe that only changes the units, i.e. mm to in.
I’ve done something similar where I find intersections in a linked structural model using the IntersectWithCurve method that solids have. One thing I had to do, that you can try, is transforming all your points. Try using the transform from the linked file to translate the points to the correct locations.
Here is some pieces of my code for reference.
I transform a curve in the model to the linked documents coordinate system then find the intersection with the slabs. Then I do the inverse transform to convert the intersection curve back to correct coordinate system.
def get_linked_file(doc):
# type: (Document) -> (RevitLinkInstance, Document)
l_doc = None
l_instance = None
link_instances = tuple(FilteredElementCollector(doc).OfClass(RevitLinkInstance)) # type: [RevitLinkInstance]
for link in link_instances:
link_name = link.Name.lower()
if 'struct' in link_name:
l_instance = link
l_doc = link.GetLinkDocument()
if l_doc is None:
print('Ensure Linked Structural Model Contains "STRUCT" (Case Is Ignored)')
raise SystemExit
else:
return l_instance, l_doc
linked_instance, linked_document = get_linked_file(DOC)
link_transform = linked_instance.GetTotalTransform()
intersect_curve = Curve.CreateTransformed(curve, transform.Inverse)
curve_intersection = tuple(solid.IntersectWithCurve(intersect_curve, solid_opt))
intersect_curve = SlabIntersection(Curve.CreateTransformed(curve_intersection[0], transform))
I cut out a lot of the code to highlight only the relevant parts, but I hope this helps you out.