hexagon logo

CMD problem from A/Car 2017 to A/Car 2018

I have a cmd file I've used for many years to extract info about my A/Car suspension assemblies. It seems to be crashing now on the last line below in A/Car 2018 and I can't see why. Any thoughts...???
 
defaults function_references show_as = partial_name
!
!------------------------------------------------------------------------------------------------------------
!>>>>>> Capture model, analysis, and subsystem names...
!
var set var=Model_Name object=(eval(db_default(.system_defaults,"model")))
var set var=Analysis_Name object=(eval(db_default(.system_defaults,"analysis")))
var set var=Subsystem_Name string_value=(str_substr(eval(Model_Name.object_value[1]),1,(str_length(eval(Model_Name.object_value[1]))-1)))
var set var=Analysis_Subsystem_Name object=(eval(Analysis_Name.object_value)//eval(Subsystem_Name.string_value))
Parents
  • Some useful 0.02$ :
    Check out the function
    subsystem_lookup(db_default(.system_defaults,"model"),"suspension","rear")
    that returns the desired subsystem object.
    Usually much more elegant than building strings ....
     
    And another one:
    var set var=xxx can turn out ambiguous. It creates the variable under the default library/model and if you do that multiple times within a session, it's likely to create a var with the same name under different locations which will throw an error.
    I always create a full path/name like:
    library create library_name = .my_own_stuff
    var cre var = .my_own_stuff.my_unique_var
    If I'm lazy, I'm using existing libs like .acar:
    var cre var = .acar.my_unique_var
     
Reply
  • Some useful 0.02$ :
    Check out the function
    subsystem_lookup(db_default(.system_defaults,"model"),"suspension","rear")
    that returns the desired subsystem object.
    Usually much more elegant than building strings ....
     
    And another one:
    var set var=xxx can turn out ambiguous. It creates the variable under the default library/model and if you do that multiple times within a session, it's likely to create a var with the same name under different locations which will throw an error.
    I always create a full path/name like:
    library create library_name = .my_own_stuff
    var cre var = .my_own_stuff.my_unique_var
    If I'm lazy, I'm using existing libs like .acar:
    var cre var = .acar.my_unique_var
     
Children
No Data