AfterDocumentOpen behavior - bug?


Hey everyone,


Today I noticed a strange behavior in the API during the AfterDocumentOpen method. Maybe someone can reproduce it and tell me, if I'm missing something or doing something strange:


  • When opening a Part file with the open file dialog, the Application.ActiveEnvironment property has the value "Part"
  • When opening the same Part file from the draft (double click on a drawing view), the Application.ActiveEnvironment property still has the value "Detail", even when retrieving the property withing the AfterDocumentOpen.


I also notice other differences. I'm modifying the material of a part after opening the document with the ApplyMaterialToDoc method. In the first case (normal open) it works flawlessly. In the second case (from the draft) a MessageBox appears after modifying the material: (translated) "The part file has unmodified changes. Save them before opening to prevent data loss.". It also appears when DisplayAlerts == false. It still applies the changes to the material though.


Is this a bug in the API or am I missing something?





Re: AfterDocumentOpen behavior - bug?


Any ideas?