McNeel Wiki
선의 종류별로 개체 선택
편집 · 인쇄 · 도움말 · 모든 항목
메뉴

AccuRender

Bongo

Brazil r/s

Flamingo

Penguin

Rhino 블로그

Rhino

Rhino Labs

검색

언어

Česky

Deutsch

English

Español

Français

Italiano

Polish

日本語

한국어

中文(繁體)

中文(简体)

 
.
DeveloperRhinoScript
Version4.0
SummaryRhinoScript 를 사용하여 선의 종류별로 개체를 선택하는 방법

질문

How can I select objects by linetype using RhinoScript?

예시

다음의 샘플 코드에서는 선의 종류(linetype)별로 개체를 선택하는 법을 소개합니다. 이 샘플에서는 특정한 선 종류가 지정딘 개체가 모두 선택되어 있습니다. 커브와 같이 일정한 개체만을 선택하는 것도 그다지 어렵지 않습니다.

  Sub SelLinetype


    Dim strLinetype
    strLineType = Rhino.GetString("Object linetype name to select")
    If Not IsString(strLinetype) Then Exit Sub
    If Not Rhino.IsLinetype(strLinetype) Then Exit Sub


    Dim arrObjects, strObject


    ' If you want to filter on all visible objects,
    ' use the following line of code.
    arrObjects = Rhino.NormalObjects


    ' Or, if you want to filter on just curve objects
    ' use the following line of code.
    ' arrObjects = Rhino.ObjectsByType(4)


    If IsArray(arrObjects) Then
      Rhino.EnableRedraw False
      For Each strObject In arrObjects
        If StrComp(Rhino.ObjectLinetype(x), strLinetype, 1) = 0 Then
          Rhino.SelectObject(strObject)
        End If
      Next
      Rhino.EnableRedraw True
    End If


  End Sub


  Function IsString(ByVal str)
    IsString = False
    If VarType(str) = vbString Then IsString = True
  End Function  
이름 바꾸기 · 변경 · 히스토리 · 구독 · 찾기 · 참조 · 파일 업로드