Skipping a Step to Avoid Error

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hey guys,

 

I'm trying to customize the setting up of simulation, so I'm using the command *createmarkpanel nodes 1 'Choose the relevant nodes for the constraints.' to create the constraints. Later on, I use the same command for creating the load.

If, for any reasons, I don't want to use this program for creating the constraints and click on proceed without marking any nodes, an error is occurring and the program stops directly. Thus, it's not possible to use the program to mark the nodes for the load afterwards.

Is it possible to somehow avoid this error?

 

Here you can find the relevant part of my script for creating the constraints:

*createentity loadcols name=loadcol1
*drawlistresetstyle
*setvalue loadcols id=1 name='Lagerung'
*startnotehistorystate {Created Constraints}
*createmarkpanel nodes 1 'Wählen Sie die Knoten der Lagerung aus.'
*loadcreateonentity_curve nodes 1 3 1 0 0 0 0 0 0 0 0 0 0 0
*endnotehistorystate {Created Constraints}

 

Kind regards,

Simon

Tagged:

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited January 2019

    Hi Simon,

     

    You can use catch like below

     

     catch {*loadcreateonentity_curve nodes 1 3 1 0 0 0 0 0 0 0 0 0 0 0}

     

  • tinh
    tinh Altair Community Member
    edited January 2019

    Or check if user not select any node:

    *createmarkpanel nodes 1 'Wählen Sie die Knoten der Lagerung aus.'

    if {[hm_marklength nodes 1]} {
         *loadcreateonentity_curve nodes 1 3 1 0 0 0 0 0 0 0 0 0 0 0

    }

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited January 2019

    Thank you guys, this solved my problem!