hexagon logo

How do I access the raw string for a runtime function?

Say I create a new run-time variable:
data_element create variable variable_name = VAR_A function = "STEP(TIME,0,0,1,1)" initial_condition = 0
 
How do I then retrieve the text of the function for design-time manipulation?
In the builder, (VAR_A.function) simply returns the object .MODEL_1.VAR_A.
 
I've found this to be true for all run-time functions which are defined using a string, such as VForces, Sforces, etc. I don't see anything else in the object browser for the variable that return its function string. I realize the workaround is to export the whole model as a cmd file, do my modifications using external software, and then re-import, but I'd rather do something a little more elegant.
Parents
  • I'm guessing that user_string() is the proper way, as Greg notes. For some reason I'm not having any luck with it, though. I can see, using DB Navigator, that you can do this:
    .MODEL_1.SFORCE_1.func.exprs
     
    so it is ".func.exprs" to return a string that looks proper. Caution: that might not be 'clean' as you would expect from a function like user_string(), so proceed with a bit of caution as there may be special cases to consider here.
     
    HTH,
    Kent
     
Reply
  • I'm guessing that user_string() is the proper way, as Greg notes. For some reason I'm not having any luck with it, though. I can see, using DB Navigator, that you can do this:
    .MODEL_1.SFORCE_1.func.exprs
     
    so it is ".func.exprs" to return a string that looks proper. Caution: that might not be 'clean' as you would expect from a function like user_string(), so proceed with a bit of caution as there may be special cases to consider here.
     
    HTH,
    Kent
     
Children
No Data