Hello everyone,
I have a list of lines for which I need to obtain the start and end point coordinates. My goal is to create these lines in RSA using the RSA API. Below is the logic I’m planning to use:
# Import the RSA API libraries
import clr
clr.AddReference('RobotOM')
import RobotOM
# Function to translate Dynamo lines to RSA nodes and bars
def translate_line_to_rsa(line, rsa_model):
start_point = line.StartPoint
end_point = line.EndPoint
# Create nodes at the start and end of the line
start_node_id = rsa_model.Project.Structure.Nodes.Create(start_point.X, start_point.Y, start_point.Z)
end_node_id = rsa_model.Project.Structure.Nodes.Create(end_point.X, end_point.Y, end_point.Z)
# Create a bar between the start and end nodes
bar_id = rsa_model.Project.Structure.Bars.Create(start_node_id, end_node_id)
# Set the section for the bar (example section name)
rsa_model.Project.Structure.Bars.Get(bar_id).SetSection('EXAMPLE_SECTION_NAME')
return bar_id
# Connect to RSA
robot_app = RobotOM.RobotApplicationClass()
robot_app.Interactive = False
robot_project = robot_app.Project
robot_structure = robot_project.Structure
# Assume 'lines' is a list of Dynamo lines passed into the script
for line in IN[0]: # IN[0] is where Dynamo inputs are accessed
translate_line_to_rsa(line, robot_project)
# Finalize changes in RSA
robot_structure.FinishEdition()
# Return something if needed
OUT = "Script completed"
However, I believe there is no command like line.StartPoint . Can anyone suggest an alternative or provide guidance on this matter?"



