0 Replies Latest reply on Sep 10, 2013 2:03 PM by Dan Hofstetter

    Flow sim API question - ApplyParametersFromFile

    Dan Hofstetter

      Hi all,


      Another Flow Sim API question.  According to the API help file, for FDAProject::ApplyParametersFromFile:  This method gets new parameter values from xml file.  I have successfully used FDAProject::ExportParametersToFile to save the flow project parameters to an XML file, and I can open that file for editing, but after saving it and trying ApplyParametersFromFile nothing seems to change.  Below is the section of the XML file I want to change:


      <FeatureNAME value="Initial Condition 1"/>


      <PS_Parameters index="8">

        <IsVisible value="1"/>

        <Name value="Hydrogen Sulfide"/>

        <ParameterID value="cb58563b-6365-4a43-9479-f03ffbaeddfe"/>

        <Type value="300"/>

        <Units value="32"/>

        <Value value="0.01"/>

        <ValueGreaterEqual value="0"/>

        <ValueType value="2"/>



      I want to change <Value value> from "0.01" to "0.0001" but nothing seems to happen when I save the new XML file and run the following code:


      Sub ApplyParametersFromFile()


          Dim NCA As New NIKCommonApiLib.BaseApiObject

          Dim IA As NIKCommonApiLib.InteractiveApplication

          Dim MD As NIKCommonApiLib.ModelDoc

          Dim MC As NIKCommonApiLib.ModelConfiguration

          Dim FDA As NIKCommonApiLib.FDAProject


          retval = NCA.LoadProductAPI("Srac\Flow Simulation 2013\API SDK")


          Set IA = NCA.Attach2RunningObject

          Set MD = IA.ActiveDocument

          Set MC = MD.ActiveConfiguration

          Set FDA = MC.GetFluidDynamicAnalysisProject


          FDA.ApplyParametersFromFile "e:\new1.xml"




      End Sub


      Can anyone help with this?