Hi Guys i would like to replicate the exact python script for Line.Bytangency node which is default node in dynamo
My goal is to write the python script for dynamo in revit for Line.Bytangency node
here is the python script which i wrote but i found error while executing
Importing necessary modules from Revit API
import clr
Import Revit API classes
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import Line
Inputs
curve = IN[0] # The input curve
parameters = IN[1] # List of parameters
tangent_lines =
Loop through each parameter in the list
for parameter in parameters:
# Evaluate the point on the curve at the given parameter
tangent_point = curve.Evaluate(parameter, True)
# Compute the tangent vector at that point
tangent_vector = curve.ComputeTangent(parameter)
# Define the length of the tangent line (you can set this as desired)
length = 10 # Adjust the length as needed
line_end = tangent_point + tangent_vector * length # Calculate the end point of the tangent line
# Create the tangent line
tangent_line = Line.CreateBound(tangent_point, line_end)
tangent_lines.append(tangent_line)
Output the list of tangent lines
OUT = tangent_lines
some one please resolve this issue i am stuck in the issue for past 1 week