We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
エレクトロニクス全般

エレクトロニクス全般

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