🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Simlab Automation Get model name for node position from node ID

User: "AjayBorah"
Altair Community Member
Updated by AjayBorah

Hello,

I am trying get model name for node position as script below

Center17673=simlab.getNodePositionFromNodeID("'''FEMModelName'''",5);
Center17674=simlab.getNodePositionFromNodeID("'''FEMModelName'''",4);
Center17675=simlab.getNodePositionFromNodeID("'''FEMModelName'''",6);
Center17676=simlab.getNodePositionFromNodeID("'''FEMModelName'''",2);
Center17677=simlab.getNodePositionFromNodeID("'''FEMModelName'''",1);
Center17678=simlab.getNodePositionFromNodeID("'''FEMModelName'''",7);


FEMModelName = simlab.getModelName("FEM");

MatchNodes=''' <MatchNodes CheckBox="ON" UUID="a1c0401f-a4d1-4f7a-8ae7-47f59af07ae7" gda="">
  <tag Value="-1"/>
  <Name Value=""/>
  <copy Value="FALSE"/>
  <lbc Value="FALSE"/>
  <flip Value="0"/>
  <FixedNode>
   <Entities>
    <Model>'''+FEMModelName+'''</Model>
    <Node>5,4,6,</Node>
   </Entities>
  </FixedNode>
  <MovableNode>
   <Entities>
    <Model>'''+FEMModelName+'''</Model>
    <Node>2,1,7,</Node>
   </Entities>
  </MovableNode>
  <Point1 Value="'''+str(Center17673).strip('()')+'''"/>
  <Point2 Value="'''+str(Center17674).strip('()')+'''"/>
  <Point3 Value="'''+str(Center17675).strip('()')+'''"/>
  <Point4 Value="'''+str(Center17676).strip('()')+'''"/>
  <Point5 Value="'''+str(Center17677).strip('()')+'''"/>
  <Point6 Value="'''+str(Center17678).strip('()')+'''"/>
  <Body>
   <Entities>
    <Model>'''+FEMModelName+'''</Model>
    <Body></Body>
   </Entities>
  </Body>
  <Output/>
 </MatchNodes>''';
simlab.execute(MatchNodes);

 

Getting Error as below...can anyone guide for the same

getModelName-------------------------------------- Passed

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getNodePositionFromNodeID------------------------- Failed
    Model name not found

getModelName-------------------------------------- Passed

MatchNodes---------------------------------------- Failed
 Fixed points are colinear. Please review your selection.

 

Thank you

Find more posts tagged with

Sort by:
1 - 1 of 11
    User: "AlessioLibrandi"
    Altair Employee
    Accepted Answer
    Updated by AlessioLibrandi

    Hello,

    this syntax

    Center17673=simlab.getNodePositionFromNodeID("'''FEMModelName'''",5);

    Seems wrong to me.

     

    Let's say, my model is called AA.gda and I want to find the position of the node 5360

    I can use the command
    Center=simlab.getNodePositionFromNodeID("AA.gda",5360);

    Now, if I put the model name in a string named FEMModelName:

    FEMModelName='AA.gda';

    then I can use the string variable in my syntax as follows:

    Center1=simlab.getNodePositionFromNodeID(FEMModelName,5360)

     

    The ''''' are not needed there, if FEMModelName is a python variable.

    I hope this can help.

     

    Alessio