Link
カテゴリ
全体 お知らせ こんなコマンドがあれば 小技 01_deles 02_txcp 03_rott 04_nl 05_bansen 06_delp 07_mdc 08_clc 09_ntra 10_excb 11_xyzl 12_dcs 13_fco 14_bbp 15_zsil 16_mic 17_selc 18/19/20 cv 21_rocp 22_exsf4 23_setc 24_mdca 25_rca 26_aca 27_exo 28_sola 29_miw 30_mcec 31_selce 32_ext 33_lsof 34_osec 35_vpl 36_cu 37_sol 38_xyzll 39_tfow 40_bbpl 41_cros 42_expib 43_sellt 44_cdc 45_pv 46_mk2d 47_src 48_al 49_cros2 50_sello 51_rco 52_cal 53_offc 最新の記事
以前の記事
ブログパーツ
検索
その他のジャンル
ファン
記事ランキング
ブログジャンル
画像一覧
|
こんにちは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
| 小技
|
ファン申請 |
||