Hi everyone, I am trying to find intersection between references of a column and a detail line using a Python script. tried everything, If anyone could help, it would be much appreciated. thenks
Hi @neria.Azriel and welcome !
are you tried this method ?
Hi, thanks for the welcome. I am really new to working in this environment. I would like to know if all the methods here can be used in Daynamo Python node?
Here is an example:
import clr
import sys
import System
#
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
import Autodesk.DesignScript.Geometry as DS
#import Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB
clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.GeometryReferences)
#import transactionManager and DocumentManager (RevitServices is specific to Dynamo)
clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
#Preparing input from dynamo to revit
wall = UnwrapElement(IN[0])
cable_tray = UnwrapElement(IN[1])
ref_face = DB.HostObjectUtils.GetSideFaces(wall, ShellLayerType.Interior)[0]
face = wall.GetGeometryObjectFromReference(ref_face)
out_InterResultArray = IntersectionResultArray()
set_ComparisonResult , out_InterResultArray = face.Intersect(cable_tray.Location.Curve, out_InterResultArray)
OUT = set_ComparisonResult.ToString(), out_InterResultArray[0].XYZPoint.ToPoint()
1 Like
Thank you very much! appreciate it ![]()
1 Like
