Get model name for renumbering in task in simlab

AjayBorah
AjayBorah Altair Community Member
edited April 2023 in Community Q&A

I am facing an issue of getting FE model name for renumbering

FEMModelName = simlab.getModelName("FEM");

Renumber=''' <Renumber UUID="28706164-a6f5-4544-b4a9-c052c4b6c60f">
  <Option Value="Nodes"/>
  <Selection Value="Model"/>
  <AdvancedOption>
   <SurfaceAndInterior Value="false"/>
   <CornerAndMid Value="false"/>
  </AdvancedOption>
  <RenumberData>
   <Model>'''+FEMModelName+'''</Model>
    <NodeStartID>101</NodeStartID>
   </Model>
  </RenumberData>
  <FileName Value=""/>
 </Renumber>''';
simlab.execute(Renumber);

 

The task shows passed  but the model is not renumbered..

But when i check with actual model name its working..

Renumber=''' <Renumber UUID="28706164-a6f5-4544-b4a9-c052c4b6c60f">
  <Option Value="Nodes"/>
  <Selection Value="Model"/>
  <AdvancedOption>
   <SurfaceAndInterior Value="false"/>
   <CornerAndMid Value="false"/>
  </AdvancedOption>
  <RenumberData>
   <Model Name="sample__source change_sltr1_SM.gda">
    <NodeStartID>101</NodeStartID>
   </Model>
  </RenumberData>
  <FileName Value=""/>
 </Renumber>''';
simlab.execute(Renumber);

 

Kindly guide.

Answers

  • AlessioLibrandi
    AlessioLibrandi
    Altair Employee
    edited April 2023

    Sometimes it is not so easy to get the right dom modifiers syntax, let's see it together.

    Your recorded script:

    Renumber=''' <Renumber UUID="28706164-a6f5-4544-b4a9-c052c4b6c60f">
      <Option Value="Nodes"/>
      <Selection Value="Model"/>
      <AdvancedOption>
       <SurfaceAndInterior Value="false"/>
       <CornerAndMid Value="false"/>
      </AdvancedOption>
      <RenumberData>
       <Model Name="sample__source change_sltr1_SM.gda">
        <NodeStartID>101</NodeStartID>
       </Model>
      </RenumberData>
      <FileName Value=""/>
     </Renumber>''';
    simlab.execute(Renumber);

     

    The line you want to edit is:

    <Model Name="sample__source change_sltr1_SM.gda">

    You replaced it with:

    <Model>'''+FEMModelName+'''</Model>

    But as you see you added a </Model> flag that was not present in the original line (the closing Model-tag comes 2 lines later)

     

    What you should have done:

    Pick the model name

    <Model Name="sample__source change_sltr1_SM.gda">

    And replace it trhough '''+FEMModelName+'''

    You get the modified line:

    <Model Name="'''+FEMModelName+'''">

    with bizarre quotes "''' and '''" :) 

     

     

    This will work!

     

    Renumber=''' <Renumber UUID="28706164-a6f5-4544-b4a9-c052c4b6c60f">
      <Option Value="Nodes"/>
      <Selection Value="Model"/>
      <AdvancedOption>
       <SurfaceAndInterior Value="false"/>
       <CornerAndMid Value="false"/>
      </AdvancedOption>
      <RenumberData>
       <Model Name="'''+FEMModelName+'''">
        <NodeStartID>101</NodeStartID>
       </Model>
      </RenumberData>
      <FileName Value=""/>
     </Renumber>''';
    simlab.execute(Renumber);

     

    Thanks