@gilboe said:
Could someone explain how I might join the dots of a pointcloud in the order that they are tabulated in the .csv file that created them.
Thank you.
This is how I do it.
def import_csv
mod=Sketchup.active_model
ent=mod.entities
@csv_dir = "c;/users/public/temp/" if !@csv_dir
@csv_file = "csv_export.csv" if !@csv_file
ctd_file=UI.openpanel("File to Import from;", @csv_dir,@csv_file)
if !ctd_file then; return; end
ctd_input=File.open(ctd_file,'r')
x,y,z = ctd_input.readline.split(",")
pp=Geom;;Point3d.new(x.to_f,y.to_f,z.to_f)
while !ctd_input.eof?
x,y,z = ctd_input.readline.split(",")
pt=Geom;;Point3d.new(x.to_f,y.to_f,z.to_f)
ent.add_line(pp,pt)
pp=pt
end
ctd_input.close
end