본문 바로가기
cs

reading a csv file - code evolved

by kmlab 2018. 4. 1.

_read_csv_add_marker.zip

https://forums.autodesk.com/t5/revit-api-forum/reading-a-csv-file-code-evolved/m-p/3303833#M2534

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;

string filepath = "insert file path here";
  if( File.Exists( filepath ) )
  {
    StreamReader s = new StreamReader(filepath );
    while( -1 != s.Peek() )
    {
      string line = s.ReadLine();
      string[] data = line.Split(new char[] { ',' } );

      XYZ p = app.Create.NewXYZ( 
        double.Parse( data[0] ), 
        double.Parse( data[1] ), 
        double.Parse( data[2] ) );

      ReferencePoint rp = doc.FamilyCreate.NewReferencePoint( p );
    }
  }

반응형

'cs' 카테고리의 다른 글

Tutorials: My First Revit Plug-in  (0) 2021.10.05
Revit API Developers Guide  (0) 2018.03.28
Youtube: Revit API C# Getting Started  (0) 2018.03.22
Creating a new Level  (0) 2018.03.21
Creating a grid with a line or an arc  (0) 2018.03.21