Accessing active Document

How are you calling the definition with your custom component? Since Rhino.Compute runs headless, there isn’t a concept of an active document on the canvas (or an active RhinoDoc for that matter).