作成した色と選択した色をカレントのTXTファイルに保存し
次回起動時に読み込むようにしました。(してもらいました。)
JW_CAD本体のカラーパレットとは同期しません。
AWKスクリプトは変更なしです。
-------------------------------------------------------
@rem 一括 ソリッド色変更(全グループレイヤ対象)
@echo off
rem
rem #jww
rem #cd
rem #h1
rem #hcソリッドの色を変更 範囲選択
rem #g1
rem #hr
rem #e
powershell -noprofile -executionpolicy bypass -command ^
"add-type -assemblyname system.windows.forms; " ^
"$d = new-object system.windows.forms.colordialog; " ^
"$d.fullopen = $true; " ^
"$sf = 'color_settings.txt'; " ^
"if (test-path $sf) { " ^
" $lines = get-content $sf; " ^
" if ($lines.count -ge 2) { " ^
" if ($lines[0]) { $d.color = [system.drawing.colortranslator]::fromhtml($lines[0]) }; " ^
" $arr = $lines[1] -split ',' | foreach-object { [convert]::toint32($_, 10) }; " ^
" $d.customcolors = $arr; " ^
" } " ^
"} " ^
"if ($d.showdialog() -eq [system.windows.forms.dialogresult]::ok) { " ^
" $hex = '#{0:x2}{1:x2}{2:x2}' -f $d.color.r, $d.color.g, $d.color.b; " ^
" set-content -path 'color.txt' -value $hex -encoding ascii; " ^
" $ccText = $d.customcolors -join ','; " ^
" @($hex, $ccText) | set-content -path $sf -encoding ascii; " ^
"}"
copy jwc_temp.txt temp.txt
jgawk -f ソリッド色変.awk temp.txt > jwc_temp.txt