I am currently attempting to create a post-processing tool (in C#) that would leverage RAM Data Access. I am having difficulty understanding the database loading procedures. From what I've seen in the developer guide, it seems the intended use is to work with a model that is not open - I would receive an error if I tried to use LoadDatabase2() on a .rss that is open. For my current problem, I would like to use the currently open model in my application. I did find a posted example that uses the .ram file located in the Working directory that accomplishes this goal. However, I am unsure of the safety of that procedure. I am also just curious as to why I can load the .ram file but not the .rss if the model is open. Is there an official approach to this problem?
All of the examples I have seen are based on opening a file through DataAccess, not working on an active file from the working directory. A Ram Structural System model .rss file is a zip file. Inside it are many files, one of which is the .ram file. If you are going to use DA with the active .ram file, I would proceed cautiously, backing up the .rss files at least.
Thank you for the reply. And absolutely, I would definitely backup and also avoid writing to the db. If you're interested, this is the link to the file I came across that used the .ram file https://communities.bentley.com/products/ram-staad/m/structural_analysis_and_design_gallery/274513
If you don't mind me following up, I am very curious as to how this works. I would have assumed that the function would restrict the filename parameter to a .rss such that it could check for the .usr file. Internally, I guess the .ram file is the one that is actually loaded and the unzipping / check for .usr file is only performed if a .rss file is specified?
You are getting beyond my expertise. The utilities we create open the .rss file silently, extracting files to the working directory, and creating the .usr lock file, exactly as would be done if the file was opened in Manager. Then the files in the working directory are updated through various DA functions, and finally the files are rezipped and put back into the parent .rss file, exactly as is done with file - save. If you skip the open part, and work on the files in the working directory I think it will be fine, I just don't have any examples like that. If you get stuck send your code and any samples, along with error messages and I can find a developer to assist.
Very helpful, thank you for your time!