Hi all,
I’m having some issues reading/writing a custom component and its properties on saving the GH document.
I’m trying to create a chunk like this:
> public override bool Write(GH_IWriter writer)
> {
> var component_chunk = writer.CreateChunk(this.InstanceGuid.ToString());
>
> *do some stuff*
>
> return base.Write(writer);
> {
Set some data to the chunk to read it on opening as follows:
> public override bool Read(GH_IReader reader)
> {
> var component_chunk = reader.FindChunk(this.InstanceGuid.ToString());
>
> *do some stuff*
>
> return base.Read(reader);
> {
However, the issue I’m facing is that this.InstanceGuid
returns a different GUID in the Read method somehow, so it cannot find the chunk.
When I just save a C# script component that returns its InstanceGUID in a document, the GUID is the same upon opening.
Can anyone explain this to me?
And is there another unique identifier that I can use to create the chunk for the specific component instance?
Otherwise I get issues when my custom component is in the definition multiple times.
Any help is appreciated!