Last active
January 2, 2016 20:39
-
-
Save GRGSIBERIA/8358367 to your computer and use it in GitHub Desktop.
選択した頂点の頂点番号をCSVにて書き出すスクリプト.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Run()関数内の処理を記述 | |
// 外部クラスの活用などは一般形式のスクリプトコードを使用してください. | |
// プラグイン変数は IPERunArgs args を通して取得可能 | |
// コードに自動的に追加されるヘッダ/フッタはメニューから有効化/確認が可能(ヘッダは標準で有効設定) | |
// 選択された頂点データの取得 | |
int[] si = args.Host.Connector.View.PMDView.GetSelectedVertexIndices(); | |
MessageBox.Show(si.Length.ToString()); | |
// PMXEditorのパスを取得 | |
var enc = System.Text.Encoding.GetEncoding("Shift_JIS"); | |
var path = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\" + @"data.csv"; | |
MessageBox.Show(path); | |
// CSVへの書き出し | |
using (var sr = new StreamWriter(path, false, enc)) { | |
for (int i = 0; i < si.Length; i++) { | |
string text = si[i].ToString(); | |
sr.WriteLine(text); | |
} | |
MessageBox.Show("end"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment