hexagon logo

A/Car is adding a suffix to my file names...

A/Car 2017.1 on Windows 10...
 
I have some full-vehicle models I run with a file driven event and the external solver. It seems A/Car is now adding a "_1", "_2", etc. to the file names as I call the cmd file for the run. I don't recall it doing this before, instead asking if i want to overwrite the existing run, and I can't seem to find the button to get it to stop. Thoughts...???
  • Can you add a few lines in your cmd file that checks if the file exists and then remove it?
    I assume that you just want to overwrite it anyway?
     
    If cond=(FILE_EXISTS ("filename.res"))
    var set var=tmp int=(REMOVE_FILE("filename.res") )
    var set var=tmp int=(REMOVE_FILE("filename.msg") )
    var set var=tmp int=(REMOVE_FILE("filename.gra") )
    var set var=tmp int=(REMOVE_FILE("filename.req") )
    end
     
     
    And: No, have never seen this. On the other hand, I don't use Windows 10 and I don't use ADAMS 2017.1. We skipped that version, only using 2017.2. And my colleagues that are on Win10 have not seen it with that version.
  • You're sure you're not using the environment ACAR_TESTING somewhere ?
    Otherwise there should be the prompt to overwrite and return if cancelled.
     
    The macros mostly check for assembly.analysis like this (Only acar toolkit check analysis checks file existence of .res/.req file.):
    ! IF ANALYSIS EXISTS, CHECK IF USER WANTS TO OVERWITE IT
    if condition = (db_exists("$assembly.$'output_prefix'_$'output_suffix'"))
      if condition = (alert("question","An analysis called \'$'output_prefix'_$'output_suffix'\' already exists. Overwrite it?", "Yes", "No", "", 2) == 2)
         variable set variable = $error_variable integer = 1
         return
      end
    end
     
    Usually it's enough to add something like this to your macro/cmd-file:
      if cond = (db_exists("$model.$analysis"))
        analysis delete analysis_name = $model.$analysis
      end
     
     
     
     
     
     
  • Jesper/Martin,
     
    Thanks for the replies.
     
    I'll try adding some lines to delete the analysis first, but never had to do this before (???). I'll also move to 17.2 just for fun...
  • Now i'm also wondering if this is a character limit issue. A/Car is also shortening the file name i'm creating. Looks like 72 is the max...???
  • This does indeed appear to be caused by the 72 character limit. Shorten up my assembly and .xml names and i get prompted to overwrite the analysis with no truncating or suffix additions to the file names. Any thing magic about 72 characters...???
  • In that case I have good news for you.
    Long ago I approched MSC to support ADAMS entities longer names. An analysis is an ADAMS object, too, and thus must fulfill the ADAMS naming convention (i.e. not start with a number, no blanks or points and not longer than xxx chars).
    The numbers are likely derived from "ye goode olde Fortran" - remember the 72 char line limit ?
     
    Just recently I went through the list of issues and this either was already released or planned for 2018.
  • Yes, in version 2018 the name length limit is modified to something very long, 240 characters I think.