diff --git a/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs b/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs index 9098f12ff..ca2be076e 100644 --- a/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs +++ b/Revit_Core_Engine/Create/FamilyInstance/FamilyInstance.cs @@ -412,6 +412,7 @@ private static FamilyInstance FamilyInstance_WorkPlaneBased(Document document, F { if (host != null) { + XYZ location; Reference reference; bool closest; @@ -419,9 +420,18 @@ private static FamilyInstance FamilyInstance_WorkPlaneBased(Document document, F if (document.PathName != host.Document.PathName) linkInstance = document.LinkInstance(host.Document.Title); - XYZ location = host.ClosestPointOn(origin, out reference, out closest, orientation?.BasisZ, linkInstance, settings); - if (location == null || reference == null) - return null; + if (host is Level) + { + location = origin; + reference = ((Level)host).GetPlaneReference(); + closest = true; + } + else + { + location = host.ClosestPointOn(origin, out reference, out closest, orientation?.BasisZ, linkInstance, settings); + if (location == null || reference == null) + return null; + } XYZ refDir = XYZ.BasisX; if (orientation?.BasisX != null)