Skip to main content

We have multiple projects and I’d like to use the same code (that i’m writing) for each project. In this code, ideally, it would write the Project Title to the database, along with some other data. How can I access that Project Title via the aimms code?

Hi Rob!

 

I played a bit with this and found a solution, by using the observation that the name of the project is always reflected in the first node in the model explorer (“Main <projectName>”). This seems to be treated as a model Section and for that reason it is the first element in the predefined set AllSections. To get to the actual model name, a simple substring operation is needed to cut off the “Main_” part in front of it:

ModelName := FormatString("%e", First(AllSections));

DialogMessage(
SubString(ModelName, 6, StringLength(ModelName))
);

(where ModelName is a string parameter in your model).

 

Hope this helps,

Mischa

 


Reply


Didn't find what you were looking for? Try searching on our documentation pages:

AIMMS Developer & PRO | AIMMS How-To | AIMMS SC Navigator