人気ブログランキング | 話題のタグを見る

Rhino+

Rhinoceros plugin開発日記
by rhino-plus
S M T W T F S
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
Link
最新の記事
bbpl バグ修正
at 2013-12-26 14:28
bansen バグ修正
at 2013-12-26 14:22
53_offc (offse..
at 2012-10-18 15:19
以前の記事
ブログパーツ
夢見る外国為替
検索
その他のジャンル
ファン
記事ランキング
ブログジャンル
画像一覧

Rhino.LayerColor (strLayer [, lngColor])

こんにちはGWも終了りますね。モチベーションを保つのが大変な時期です・・・・。
さてpluginを改良していてサンプルスクリプトで便利な記述があったので紹介します。
Rhino.LayerColorですがこれはレイヤの色を変更するコマンドです。
このコマンドを利用して全レイヤ色をランダムに一度に変更することが可能になります。
ヘルプを見るにはライノセラスのコマンドにeditscriptと入力して立ち上がったダイアログボックスからヘルプを参照できます。
以下がプログラムです。

--------------------------------------------------------
Dim arrLayers, strLayer

arrLayers = Rhino.LayerNames

If IsArray(arrLayers) Then

    For Each strLayer In arrLayers
      Rhino.LayerColor strLayer, RandomColor
    Next
End If

Function RandomColor()
Dim intRed, intGreen, intBlue

Randomize

intRed = Int(255 * Rnd)
intGreen = Int(255 * Rnd)
intBlue = Int(255 * Rnd)

RandomColor = RGB(intRed, intGreen, intBlue)

End Function
--------------------------------------------------------
どうですか?上記項目をrvbファイルに変更して実行してみてください。
rvbファイルは.txtの拡張子を.rvbに変更で完成です。pluginインストールの方法はこちらに記述してあります。

Rhino+に加えようかと思いましたがそのままコピーでは開発者魂が許さなかったので、ならばブログで紹介しようと思いました。
ヘルプのサンプルも便利なコマンド満載です。
皆さんも改めて見てみては?新しい発見がありますよ。


Hi,I am improving mdc plugin now .
I found a useful script from Rhino help.Script is Rhino.LayerColor.
This is the command to change the color of the layer.
It will possible to change the all layer color at once at random.
Please try it.
--------------------------------------------------------
Dim arrLayers, strLayer

arrLayers = Rhino.LayerNames

If IsArray(arrLayers) Then

    For Each strLayer In arrLayers
      Rhino.LayerColor strLayer, RandomColor
    Next
End If

Function RandomColor()
Dim intRed, intGreen, intBlue

Randomize

intRed = Int(255 * Rnd)
intGreen = Int(255 * Rnd)
intBlue = Int(255 * Rnd)

RandomColor = RGB(intRed, intGreen, intBlue)

End Function
--------------------------------------------------------

by rhino-plus | 2011-05-05 17:04 | 小技
<< mdc(Match displ... mic (Mirror cp... >>