585,927 active members*
3,431 visitors online*
Register for free
Login

Thread: Macro WIZARD

Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2005
    Posts
    1145

    Macro WIZARD

    Here is a NEW and upcoming feature for UCcnc macros. You will be able to build a conversational Macro WIZARD (;-). This is an example of a Bolt Circle Wizard built as a macro and can be called as a Mcode or a button code.

    (;-) TP

  2. #2
    Join Date
    Jun 2015
    Posts
    943

    Re: Macro WIZARD

    That looks a nice feature. Thanks for sharing.

  3. #3
    Join Date
    Nov 2006
    Posts
    40

    Re: Macro WIZARD

    These can be really useful, nice to be able to stay within the software to build up a program as you go.
    Mark

  4. #4
    Join Date
    Apr 2014
    Posts
    215
    Quote Originally Posted by vmax549 View Post
    Here is a NEW and upcoming feature for UCcnc macros. You will be able to build a conversational Macro WIZARD (;-). This is an example of a Bolt Circle Wizard built as a macro and can be called as a Mcode or a button code.

    (;-) TP

    Very nice feature.

    Rob

  5. #5
    Join Date
    Apr 2014
    Posts
    215

    Re: Macro WIZARD

    TP,

    Has this Macro Wizard come from here? or rather using this type of macro call?

    The macro text typed into the macro file is inside a function of a class and therefor defining other functions and global variables directly inside the macro is not possible.
    Defining global variables and functions is possible only at the end of the macro text file with writting the #Events text into the macro, this text will let the UCCNC know that the remaining text of the macro has to be compiled outside of the function, but still inside the macro class.
    The following example shows a simple macro which creates a Windows Form and adding a button to it and assigning an event handler to the button's click event.
    The example also declares a function which is then called from inside the macro.

    Button MyButton = new Button();
    MyButton.Size = new System.Drawing.Size(80, 40);
    MyButton.Location = new System.Drawing.Point(110, 130);
    MyButton.Text = "Press me";
    MyButton.Click += new EventHandler(MyButton_Click);

    MyForm = new Form();
    MyForm.Size = new System.Drawing.Size(300, 300);
    MyForm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScree n;
    MyForm.Controls.Add(MyButton);
    MyForm.ShowDialog();

    MyFunction();

    #Events

    Form MyForm; //This is a global variable, a Windows Form

    void MyButton_Click(object sender, EventArgs e)
    {
    MessageBox.Show("Mybutton was clicked!");
    MyForm.Close();
    }

    void MyFunction()
    {
    exec.Code("G0 X10");
    }


    Does this mean that these form methods will become available?

    https://msdn.microsoft.com/en-us/lib...v=vs.110).aspx

    Thanks

    Rob

  6. #6
    Join Date
    Oct 2005
    Posts
    1145

    Re: Macro WIZARD

    HI Robert YES it came from that type of macro using the #events feature. NOW exactly what else it can use I have no idea I used it to teh point of creating a wizard and have not done any more exploring . I used Sharp Develope to create the form design and graphed the script code into the macro. I then had to juggle a few things around to make it all work. One of the major thing I had to figure out with Balazs help is you HAVE to define the Form variables(textBox) in teh event section. There they become gobal and the form can see them AND teh #event side can use them. IF they are defined on the form side then teh Event side cannot see them. SO if you needed to used the variable to do a function it would not work.

    I can send you the script of that wizard if you want to see it. It aint pretty but it does work.

    (;-) TP

    (;-) TP

  7. #7
    Join Date
    Apr 2014
    Posts
    215

    Re: Macro WIZARD

    TP,

    Thanks for the heads up on Sharp Develop (never heard of it before, taking a look at present).

    Yes I'd like to have a look, the "prettiness" of the script doesn't matter, its just nice to see more examples, so you can get an idea of what others have done that worked, what it looks like, and give ideas of what to try.

    Thanks again,

    Rob

  8. #8
    Join Date
    Oct 2005
    Posts
    1145

    Re: Macro WIZARD

    HI Robert you may want top consider Visual Studio 2010 express for building teh Macro Wizard elements.

    (;-) TP

Similar Threads

  1. G32 macro or wizard for Mach3
    By Coolant Slinger in forum Mach Wizards, Macros, & Addons
    Replies: 1
    Last Post: 03-08-2013, 12:02 AM
  2. Replies: 2
    Last Post: 12-19-2012, 01:28 PM
  3. Replies: 3
    Last Post: 02-13-2012, 07:20 PM
  4. Replies: 2
    Last Post: 03-27-2009, 09:15 PM
  5. Nesting Wizard, Mach3 internal wizard.
    By thuffner3 in forum Mach Software (ArtSoft software)
    Replies: 1
    Last Post: 03-05-2007, 03:38 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •