Hello, World!
Today I start to learn workflows (AutoCAD Map 3D 2014).
I make a class WorkflowPlugIn with an entry point (Start() method), add workflow in Infrastrusture Admin with scenario script.
That was straight from Developer's Guide and it works fine.
public class CopyObjectAttributes : WorkflowPlugIn
{
Start()
{ // some code }
}
But what if I want to start workflow from a command (not using TBEXECUTE)?
So I Add this
[CommandMethod("MyCommand")]
Start()
{ ... some code }
And when I call MyCommand in command line... it crashes Map 3D with
"Unhandled Access Violation Reading 0x0010 ..." etc.
The thing is that when I call MyCommand in my WorkflowPlugIn, Document = null.
Why? And how to fix this? Maby there is another way to start workflow programmatically.