RhinoDoc.ActiveDoc vs doc

Hi, I was wondering, is saying RhinoDoc.ActiveDoc and doc the same? In the documentation it says:
“WARNING!! Do not use the ActiveDoc if you don’t have to. Under Mac Rhino the ActiveDoc can change while a command is running. Use the doc that is passed to you in your RunCommand function or continue to use the same doc after the first call to ActiveDoc.”
Does doc. not have the same problem?
How should I refer to it in Visual Studio (I was using doc.DoSomething in the C# component inside grasshopper, but does not work in VS).
Same problem with this.Component, how do I reference it in Visual Studio to do an ExpirePreview?

Another question: I am not completely clear about the environment in the c# component. Is the RunScript like a function/method inside a class and the other white (empty writable) space ( // ) another part in the same namespace and class but outside of this function/method?

Thank you in advance.

here’s some python doc context info Creating a new viewport with python/rhinocommon - #7 by stevebaer

1 Like

Thank you!