So I try to override the ReadDocument method which gets called when I open a .3dm-file, right?. So I have a file called “name.3dm” already saved on my machine and when I open it, the breakpoint I set in my override ReadDocument method works, but the doc.Path field is empty. Why is that?
Btw: The name is empty too, but all the other data is there, like the materials and objects and so on…
Yes, this workaround does works if the following is true: DocumentEventArgs e as parameter and then e.Document is the same as (equivalent to) DocumentOpenEventArgs e and then e.Document in this only case of OnEndOpenDocument()
P.S. Is it weird that for Mac I don’t need this workaround and doc.Path is not empty?
@dale this wasn’t fixed ? I’m looking for other files in diectory where 3dm file is located during reading archive and also stuck on this. OnEndOpenDocument is before ReadDocument?
Besides any real reason why this is null during reading doc?
If obtaining the document path is important, then use this pattern. Note, Rhino opens more than just .3dm files. Thus, RhinoDoc.Path can still be null even after Rhino has returned control to the user.
@dale I’m having trouble with idle it seems not performing code that is written and can debug it as VS tells me that somehow on fly source code has changed (?) it behaves really strange. Any ideas?
[EDIT]: No worries VS just got crazy for some reason after reboot back to normal.
Maybe i’m doing too much though i tried to do the same as above for document unit system but seems this is read wrong so i had to read it via File3dm.Read … I tried to use e from EndOpenDocument or ReadDocument but i always get invalid results there.
[EDIT]: Though above still remains true - It’s bit weird that for eg. on import all Open events are launched but there is no access to imported file and doc properties don’t you think?