We’re putting the final touches on our new badges platform. Badge issuance remains temporarily paused, but all completions are being recorded and will be fulfilled once the platform is live. Thank you for your patience.
エレクトロニクス全般

エレクトロニクス全般

Script:Design変数名と設定値の取得 (GetVariables, GetVariableValue)

    • FAQFAQ
      Participant

      Design変数名と設定されている値をスクリプトで取得することが可能です。 使用するコマンド ・デザイン変数名を取得する:GetVariables() ・デザイン変数に設定された値を取得する:GetVariableValue(<VarName>) デザイン変数名と値を取得して MessageBox で表示する VBS のサンプルコードを下記に示します。 <注意>本サンプルコードは、全ての動作を保証するものではありません。 ——————————————————————– Set oAnsoftApp = CreateObject(“Ansoft.ElectronicsDesktop”) Set oDesktop = oAnsoftApp.GetAppDesktop() oDesktop.RestoreWindow Set oProject = oDesktop.GetActiveProject() Set oDesign = oProject.GetActiveDesign() design_var_array = oDesign.GetVariables() for i=0 to UBound(design_var_array) design_var_value = oDesign.GetVariableValue(design_var_array(i)) msgbox design_var_array(i) & ” : ” & design_var_value next ——————————————————————– キーワード: Script, スクリプト, VBS, IronPython, GetVariables, GetVariableValue