Hi,Help this.
My code.
using comApi = Autodesk.Navisworks.Api.Interop.ComApi;
using ComApiBridge = Autodesk.Navisworks.Api.ComApi;
ComApi.InwOpState10 state = ComApiBridge.ComApiBridge.State;
Error Message -> MainDocument is null | COMApi not available.
What's wrong?
Solved! Go to Solution.
Solved by xiaodong_liang. Go to Solution.
Hi,
any .NET control based app must call call SetAsMainDocument in order to communicate with COM interop.
Note:
- only one control can call this method. That means only one control can talk to COM. when you load A document with the control, the COM Bridge returns the info of A, if loading B document, the COM Bridge returnes the info of B
- this method can only been called one time in a life time of one app
Dear XiaoDong,
May I know why SetAsMainDocument can only be called once?
In our program, we need to Terminate the API and re-initialize it again.
However, we need to use this method again after re-initializing the API.
Could you please help?
Thanks,
John
Hi Xiaodung,
Thanks for answering me.
We need to switch the ApplicationType (SingleDocument, MultipleDocument), which cannot switch after initializing the API.
That's why we need to reinitialize the API.
Could you give us some clues how we can achieve it?
Thank you very much.
John
Hi Xiaodung,
Thanks for your reply.
The reason I need to switch the document mode is I cannot view the texture of texture embedded model in Multi document mode.
However, I want to allow user to open multi documents when the model is not embedded texture.
Also, I need to allow user switch model between texture model and non texture model.
Could you give me some ways to do so?
Thanks,
John
Hi Xiaodong,
Thanks for logging it.
Could you please update me if they complete this issue?
Thank you,
Best Regards,
John