C#ATIA

↑タイトル詐欺 主にFusion360API 偶にCATIA V5 VBA(絶賛ネタ切れ中)

"group" フォルダは犠牲にした、プルダウンリストライブラリ

相変わらず、PowerMillが使いこなせていない・・・。

方向性を定める為、イロイロと試していた為マクロの製作も止めていました。
少しづつ迷いが取れきたので、少しマクロで楽をしたいところ。

使い回しが出来そうなので、"group" フォルダは犠牲にしたプルダウンリストを
ライブラリ化しました。 こちらのものに近いものです。
アクティブなブロックを未計算ツールパスに反映させる - C#ATIA

//PMill_Macro
//downmenu.inc

//ダウンメニュー
//pram  :Lst-選択肢リスト
//pram  :Msg-メッセージ
//pram  :AbortFg-未選択時の処理 0-空を返す 1-終了
//return:OutLst-選択されたリスト
function Exec_DownMenu(string list Lst, string Msg, bool  AbortFg, output string list OutLst) {
	$OutLst = {}
	string allword = '全て'
	
	//実行確認
	call Can_Exec()
	
	//先頭に全てを追記
	int dmy = add_first($Lst, $allword)
	
	//ダミー
	call Create_DmyGroup($Lst) 
	
	//ユーザー選択
	entity list grps =  input entity multiple group $Msg
	DELETE GROUP ALL
	EDIT RECYCLER DELETE Group ALL
	if is_empty(grps) {
		if $AbortFg==1 {
			macro abort
		} else {
			return
		}
	}
	string list sels = extract(grps , 'name')
	
	//選択要素
	if $sels[0] == $allword {
		string tmp = remove_first($Lst)
		$OutLst = $Lst
	} else {
		$OutLst = $sels	
	}
	return
}

//選択用ダミー作成
function Create_DmyGroup(string list Lst) {
	foreach txt in $Lst {
		CREATE GROUP ;
		RENAME Group "1" $txt
	}
}

//条件確認
function Can_Exec() {
	if not (is_empty(folder('group'))) {
		string msg = 'グループフォルダを利用する為、グループフォルダをクリアします。' + crlf + '宜しいですか?'
		bool yn = 0
		$yn = QUERY $msg
		if not $yn {
			macro abort	
		}
		DELETE GROUP ALL
	}
}

これ自体は特に何かが出来るものでは無いため、説明は割愛。
使用例はそのうちUpします。(出来ると良いな・・・)