Opening a fsd file through COM
Moderator: jasper
Opening a fsd file through COM
Hi Jasper,
Suppose that I have COCO installed and correctly registered. Is it possible to open a simulation file (fsd) through COM (that is, without opening COFE) and access all the flowsheet items (streams and unit operations) as CAPE-OPEN objects?
Regards
Daniel
Suppose that I have COCO installed and correctly registered. Is it possible to open a simulation file (fsd) through COM (that is, without opening COFE) and access all the flowsheet items (streams and unit operations) as CAPE-OPEN objects?
Regards
Daniel
Re: Opening a fsd file through COM
You can open a flowsheet document via COM, yes. This requires creating an OLE version of COFE (via automation, see here for the details http://cocosimulator.org/index_help.php ... mation.htm), but you can of course hide the OLE site if you write that yourself.
Not sure where you want to go, but another way to access an fsd as an object would be as a CAPE-OPEN unit operation: http://cocosimulator.org/index_help.php ... heetuo.htm
Not sure where you want to go, but another way to access an fsd as an object would be as a CAPE-OPEN unit operation: http://cocosimulator.org/index_help.php ... heetuo.htm
Re: Opening a fsd file through COM
Thanks for the answer, Jasper.
I've developed a capital cost estimation tool which currently works as a plugin for dwsim. I'm working on making it standalone, being able to open flowsheets from other simulators to read data from the streams and unit operations via an "import" tool.
It's been a while since I've worked with the flowsheet monitoring interface, but I'll see if can make it work with COCO through that interface as well.
I've developed a capital cost estimation tool which currently works as a plugin for dwsim. I'm working on making it standalone, being able to open flowsheets from other simulators to read data from the streams and unit operations via an "import" tool.
It's been a while since I've worked with the flowsheet monitoring interface, but I'll see if can make it work with COCO through that interface as well.
Re: Opening a fsd file through COM
That would be very nice - note that the monitoring interface is in a review stage in the M&T group, after which it will be officially published, with a bunch of modifications.
Re: Opening a fsd file through COM
If you want to grab and interpret the content of a flowsheet document, I would recommend monitoring (best the newly unreleased interface, I can upgrade to that as well).
There is an alternative for COFE - which is to unpack the fsd and parse the xml.
There is an alternative for COFE - which is to unpack the fsd and parse the xml.
Re: Opening a fsd file through COM
Is it a ZIP file too? I'll take a look, that would be better because the user wouldn't need to have COCO installed (or installed without admin privileges).jasper wrote:If you want to grab and interpret the content of a flowsheet document, I would recommend monitoring (best the newly unreleased interface, I can upgrade to that as well).
There is an alternative for COFE - which is to unpack the fsd and parse the xml.
Do you know if there's a simulator which supports the Flowsheet Monitoring interface other than COCO and DWSIM?
Re: Opening a fsd file through COM
No - not at this point. But several parties have expressed an interest in implementing it once it is published.
Re: Opening a fsd file through COM
COFE's XML file seems very "human-readable". I'll proceed through this path and get back here as soon as I have something to show.
Re: Opening a fsd file through COM
Ok - note that COUSCOUS units and TEA will write to IPropertyBag, which translates nicely to XML, but many PMCs don't, in which case the content of the PMC will be a BASE64 blob.
Re: Opening a fsd file through COM
I've finished the Import tool. I'm mapping some COUSCOUS unit operations according to cost data availability.
The workflow to import data from a FSD file is very simple:
I also map material and energy streams to Materials and Utilities.
The workflow to import data from a FSD file is very simple:
I also map material and energy streams to Materials and Utilities.