Load model from memory
Load model from memory
In KernelCAD there was a method to load a model from memory, IModelEx.LoadFromMemory(), is there a way to do this in DG Kernel?
Re: Load model from memory
Hi Aaron
Strictly speaking it should be working, despite it was declared deprecated, but I do not remember any recent mentioning of it.
We will take a close look at it shortly to check if it does. Please keep an eye on this thread.
Regards
Strictly speaking it should be working, despite it was declared deprecated, but I do not remember any recent mentioning of it.
We will take a close look at it shortly to check if it does. Please keep an eye on this thread.
Regards
Re: Load model from memory
Ah, I was using the IModel_DG interface and didn't see the method in there. I didn't think to try casting it to IModelEx. I will play around with that method, thanks.
Re: Load model from memory
Hi Aaron
There was a bug. Sorry. It was kind of grey area missed in tests.
Please get today's 5215 update: [url../ProDown.htm]Downloads[/url]
If you intend to load an .mdg, call it like:
Not with 0 format. 0 is .glm (should work as well).
See an example in Test_IModel_DG.TestLoadFromMemory() of Samples\NET\C#\Tests\InterfaceTests\Test_IModel_DG.cs (Load Samples\NET\C#\Tests\InterfaceTests\InterfaceTests.sln)
We will add this to _DG interface also in the next version
Regards
There was a bug. Sorry. It was kind of grey area missed in tests.
Please get today's 5215 update: [url../ProDown.htm]Downloads[/url]
If you intend to load an .mdg, call it like:
Code: Select all
iModelEx.LoadFromMemory(arr, (int)ECADFormat.eCADFormatMDG);
See an example in Test_IModel_DG.TestLoadFromMemory() of Samples\NET\C#\Tests\InterfaceTests\Test_IModel_DG.cs (Load Samples\NET\C#\Tests\InterfaceTests\InterfaceTests.sln)
We will add this to _DG interface also in the next version
Regards
Re: Load model from memory
Thanks Nick, I can verify it is working for the MDG models, however it is not working for GLM models. I plan on moving to MDG going forward but we have a ton of GLM models out in the wild that we will still need to support.
I am using the ECADFormat.eCADFormatGLM when trying to load GLMs but the view is empty and no error is thrown.
I am using the ECADFormat.eCADFormatGLM when trying to load GLMs but the view is empty and no error is thrown.
Re: Load model from memory
Hmm. I am sure we got this working.
Checking...
Checking...
Re: Load model from memory
This should be working now after today's 5217 update Download.
See the Test_IModel_DG.TestGlmMemoryPersit() in DGKernel_6_2\Samples\NET\C#\Tests\InterfaceTests\Test_IModel_DG.cs, C#\Tests\InterfaceTests sample project.
Regards
See the Test_IModel_DG.TestGlmMemoryPersit() in DGKernel_6_2\Samples\NET\C#\Tests\InterfaceTests\Test_IModel_DG.cs, C#\Tests\InterfaceTests sample project.
Regards