Hi, I have this problem when I try to use python script to read and insert 3dm object through a csv file and move them to the correct position, also read from a csv file.
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg
import Rhino
import scriptcontext
import System.Guid
import scriptcontext as sc
import os
#############################################
#Select a file to open
filename = rs.OpenFileName("Open CSV file","*.csv|", None, None, None)
#open the file for reading
file = open(filename, 'r')
lines = file.readlines()
file.close()
del lines[0]
#Read the lines in excel sheet and define the values needed
for line in lines:
line = line.rstrip()
ptInfo = line.split(',')
## Start to Insert objects
#Read the position coordinates of the object
x = 1000*float(ptInfo[4])
y = 1000*float(ptInfo[5])
z = 1000*float(ptInfo[6])
arrPoint = x,y,z
#Read the path and insert the object
file = ptInfo[7]
rs.Command('_-Import ' + file + ' _Enter')
#Try to move it to the correct position
arrObjects = rs.LastCreatedObjects
rs.MoveObjects(obj, arrPoint)
