McNeel Wiki
커브의 제어점 내보내기 (Export)
편집 · 인쇄 · 도움말 · 모든 항목
메뉴

AccuRender

Bongo

Brazil r/s

Flamingo

Penguin

Rhino 블로그

Rhino

Rhino Labs

검색

언어

Česky

Deutsch

English

Español

Français

Italiano

Polish

日本語

한국어

中文(繁體)

中文(简体)

 
.
DeveloperRhinoScript
Summary커브 제어점의 3D 좌표값을 텍스트 파일로 내보내기

샘플 코드

다음의 샘플 코드는 커브를 선택하고 해당 커브의 3D 좌표값을 텍스트 파일로 내보내는 방법을 소개합니다.

    Sub ExportControlPoints


      'Pick a curve object
      Dim strObject
      strObject = Rhino.GetObject("Select curve", 4)
      If IsNull(strObject) Then Exit Sub


      ' Get the curve's control points
      Dim arrPoints
      arrPoints = Rhino.CurvePoints(strObject)
      If Not IsArray(arrPoints) Then Exit Sub


      ' Prompt the user to specify a file name    
      Dim strFilter, strFileName
      strFilter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*||"
      strFileName = Rhino.SaveFileName("Save Control Points As", strFilter)
      If IsNull(strFileName) Then Exit Sub


      ' Get the file system object
      Dim objFSO, objStream
      Set objFSO = CreateObject("Scripting.FileSystemObject")


      ' Open a text file to write to
      On Error Resume Next
      Set objStream = objFSO.CreateTextFile(strFileName, True)
      If Err Then
        MsgBox Err.Description
        Exit Sub
      End If


      ' Write each point as text to the file
      Dim strPoint, strText
      For Each strPoint In arrPoints
        strText = Rhino.Pt2Str(strPoint)
        objStream.WriteLine(strText)
      Next


      ' Close the file
      objStream.Close


    End Sub
이름 바꾸기 · 변경 · 히스토리 · 구독 · 찾기 · 참조 · 파일 업로드