hexagon logo

Get the information from the program visible in Command Mode via VB or C#?

I'm specifically interested in the date and time.​


Attached Files
Parents
  • Well, I haven't had a chance to try this myself using a delegate. Here is an example Pseudo code.

    class Program
    {
        // Define the delegate and event
        public delegate void OnReportPrintStartDelegate(PartProgram PartProg, DateTime eventDateTime);
        public event OnReportPrintStartDelegate OnReportPrintStart;
    
        static void Main(string[] args)
        {
            // Your main program code here...
            dynamic App = Activator.CreateInstance(Type.GetTypeFromProgID("Pcdlrn.Application"));
            dynamic PartProg = App.ActivePartProgram;
    
            // Raise the event and pass the current date and time as an argument
            OnReportPrintStart?.Invoke(PartProg, DateTime.Now);
        }
    }​​
    
  • Thanks again for your help! After digging in a little further I think I misunderstood what that time actually represents. It seems like it gets updated anytime you open or execute the program and then the report header always shows the time that the report was printed. I don't think that will work for my purposes.
Reply Children
No Data