Open ryan-kipawa opened 3 years ago
Are custom blocks relevant for all types of dfs files or only dfs2?
You are welcome to investigate how to read/write custom blocks. To get started:
Then we can start thinking about where this functionality belongs in mikeio.
I don't know how exactly how it's used in every DFS file, but it seems it's at least possible:
http://docs.mikepoweredbydhi.com/core_libraries/dfs/dfs-file-system/#custom-blocks
I'm mostly familiar with DFS2 custom blocks. For example, the M21_Misc custom block contains the land value as item #4.
How / where can I upload the sample file and script? Here's an image of the code for now...
Custom block are relevant for dfs2, dfs3 and dfsu, and also for some generic dfs files (like .res1d).
There are some examples on how to work with custom blocks in Python here:
https://github.com/DHI/mikecore-python/blob/master/tests/test_dfs_custom_block.py
The following example shows how to handle custom block for dfs2 files, and also how to create file with a valid custom block.
https://github.com/DHI/mikecore-python/blob/master/tests/examples_dfs2.py
Any progress on this feature? I think MikeIO is a great toolbox and prefer using it without necessity for MikeCore.
Also still hoping to see this feature implemented :)
(now posting from my corporate GitHub account...)
@rywm-dhi @jurjendejong @sweco-sejurj Is the functionality in #675 sufficient?
Nice! I think that's sufficient for writing blocks. Is it also possible to read the values?
Awesome! This looks like it should do the trick.
I don't believe mikeio can read/write custom blocks to dfs2 files yet. These have info that's sometimes used by other tools. Therefore, it'd be nice to be able to read/write these.