McNeel Wiki
레이어 개체 내보내기
편집 · 인쇄 · 도움말 · 모든 항목
메뉴

AccuRender

Bongo

Brazil r/s

Flamingo

Penguin

Rhino 블로그

Rhino

Rhino Labs

검색

언어

Česky

Deutsch

English

Español

Français

Italiano

Polish

日本語

한국어

中文(繁體)

中文(简体)

 
.
DeveloperRhinoScript
Summary각 레이어를 새 파일로 내보내며, 레이어별로 모든 개체를 내보내는 방법.

다음의 RhinoScript 는 각 레이어를 새 파일로 내보내며, 레이어별로 모든 개체를 내보내는 방법을 소개합니다.

        Option Explicit


        Sub ExportLayerObjects


          ' Declare local variables
          Dim strPath, strFile
          Dim arrLayers, strLayer
          Dim arrSelected


          ' Get the path to and name of the current document.
          ' Surround with double-quotes in case path includes spaces.
          strPath = Chr(34) & Rhino.DocumentPath & Rhino.DocumentName & Chr(34)


          ' Get names of all layers
          arrLayers = Rhino.LayerNames


          ' Disable redrawing
          Rhino.EnableRedraw False


          ' Process each layer
          For Each strLayer In arrLayers


            ' Unselect all   
            Rhino.Command "_-SelNone", 0


            ' Select all objects on layer. Surround layer name
            ' with double-quotes in case it includes spaces.
            Rhino.Command "_-SelLayer " & Chr(34) & strLayer & Chr(34), 0


            ' Make sure some objects were selected
            arrSelected = Rhino.SelectedObjects
            If IsArray(arrSelected) Then


              ' Generate a modified path string
              ' that includes the layer name
              strFile = strPath
              strFile = Replace(strFile, ".3dm", "_" & strLayer & ".3dm")


              ' Export the selected objects
              Rhino.Command "_-Export " & strFile, 0


            End If
          Next


          ' Unselect all
          Rhino.Command "_-SelNone", 0


          ' Enable redrawing
          Rhino.EnableRedraw True


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