Syntax Error in Template, MotionView

Davide_21943
Davide_21943 Altair Community Member
edited November 2021 in Community Q&A

I have problems with templates in MotionView tutorials: 

Tutorials/Rigid Body Dynamics/MV-1011 and MV-1051.

MotionView reports the following error: "Syntax error in expression:...<!--Deactivate the extension motion first -->......Templex error evaluating text under Model-Template. [General]".

I just copy and paste the script for the template written in the tutorials and change the varname for the model.

{<!--Deactivate the extension motion first -->
<Deactivate
element_type = "MOTION"
element_id = "{the_model.mot_ext.idstring}"
/>}

I have changed "MODEL" to "the_model". I have tried several things but nothing seems to work. 

Best Answer

  • Praful
    Praful
    Altair Employee
    edited November 2021 Answer ✓

    Hello Davide -

    I see additional {} paranthesis (curly braces), one at the beginning and one at the end, that is giving the error. I have highlighted it in red below

    {<!--Deactivate the extension motion first -->
    <Deactivate
    element_type = "MOTION"
    element_id = "{the_model.mot_ext.idstring}"
    />}

    When adding a template you'll see a {} already put in. If you are copy-pasting, you may remove this set of curly braces. That should fix the error.

    regards

    praful

Answers

  • Praful
    Praful
    Altair Employee
    edited November 2021 Answer ✓

    Hello Davide -

    I see additional {} paranthesis (curly braces), one at the beginning and one at the end, that is giving the error. I have highlighted it in red below

    {<!--Deactivate the extension motion first -->
    <Deactivate
    element_type = "MOTION"
    element_id = "{the_model.mot_ext.idstring}"
    />}

    When adding a template you'll see a {} already put in. If you are copy-pasting, you may remove this set of curly braces. That should fix the error.

    regards

    praful

  • Davide_21943
    Davide_21943 Altair Community Member
    edited November 2021

    Hello Davide -

    I see additional {} paranthesis (curly braces), one at the beginning and one at the end, that is giving the error. I have highlighted it in red below

    {<!--Deactivate the extension motion first -->
    <Deactivate
    element_type = "MOTION"
    element_id = "{the_model.mot_ext.idstring}"
    />}

    When adding a template you'll see a {} already put in. If you are copy-pasting, you may remove this set of curly braces. That should fix the error.

    regards

    praful

    There are no erros without the curly braces.

    So when I add a Template, I have to delete {} and type:

    <!--Deactivate the extension motion first -->
    <Deactivate
    element_type = "MOTION"
    element_id = "{the_model.mot_ext.idstring}"
    />

     

  • Praful
    Praful
    Altair Employee
    edited November 2021

    There are no erros without the curly braces.

    So when I add a Template, I have to delete {} and type:

    <!--Deactivate the extension motion first -->
    <Deactivate
    element_type = "MOTION"
    element_id = "{the_model.mot_ext.idstring}"
    />

     

    That is correct. The text within the curly braces are processed through a math processor within HyperWorks called Templex. In your case, the first level of braces were sending all the text to the processor and it could not evaluate the expression unlike for the expression {the_model.mot_ext.idstring}, which the templex can find and resolve it.

    Regards

    praful