Wizard toolpath solutions?

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: Wizard toolpath solutions?

Postby Vmax549 » Wed Nov 29, 2017 9:09 pm

HI Robert you can still do your thing just use teh onscreen toolpath to display teh pathing. Open your wizard to a page that already has a toolpath window. That is what I do here.
Conversational programing works GREAT with Wizards.

Just a thought, (;-)
Vmax549
 
Posts: 515
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Wizard toolpath solutions?

Postby Robertspark » Thu Nov 30, 2017 10:59 pm

anyone got any suggestions with these macro wizard forms to limit textbox entry to numeric + decimal point only?

Thanks in advance

{quiet on the forum at present... christmas shopping?}
Rob

Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
UC400eth, UC300eth, UCCNC v1.2046, Neuron Lite.
UCCNC Macro Manual
Robertspark
 
Posts: 598
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Wizard toolpath solutions?

Postby cncdrive » Thu Nov 30, 2017 11:26 pm

Hi Rob,

Yes, Christmas shopping is ongoing, but it is not me shopping, but customers shopping at us, so I didn't have time to do the shopping yet. :)

Some code for what you want to do with the textbox:

Code: Select all
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
    if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) &&
        (e.KeyChar != '.'))
    {
            e.Handled = true;
    }

    // only allow one decimal point
    if ((e.KeyChar == '.') && ((sender as TextBox).Text.IndexOf('.') > -1))
    {
        e.Handled = true;
    }
}
cncdrive
Site Admin
 
Posts: 1365
Joined: Tue Aug 12, 2014 11:17 pm

Re: Wizard toolpath solutions?

Postby Robertspark » Fri Dec 01, 2017 7:23 am

Thanks Balazs
Good to hear the shop is busy, plus you're getting some fallout of the cyber Monday.


Are you going to alpha test the g41/g42 version with users?
Rob

Einstein ― “If you can't explain it to a six year old, you don't understand it yourself”
UC400eth, UC300eth, UCCNC v1.2046, Neuron Lite.
UCCNC Macro Manual
Robertspark
 
Posts: 598
Joined: Sat Sep 03, 2016 4:27 pm
Location: Nr Liverpool, England

Re: Wizard toolpath solutions?

Postby Vmax549 » Fri Dec 01, 2017 2:44 pm

Balazs that trick does format teh data you retreive from teh form. Can you limit what teh form will take when you enter teh value.

Say your input requires 12.345 ( XX.XXX) and you mistakenly enter xx.cat . Can you format teh field to reject teh NON numeric part ??

(;-) TP
Vmax549
 
Posts: 515
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Wizard toolpath solutions?

Postby dezsoe » Fri Dec 01, 2017 2:54 pm

No, that trick makes exactly what you want. It rejects any keys that are not digits, controls or the decimal point.
dezsoe
 
Posts: 216
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Wizard toolpath solutions?

Postby Dan911 » Sat Dec 02, 2017 12:24 am

Vmax549 wrote:Balazs that trick does format teh data you retreive from teh form. Can you limit what teh form will take when you enter teh value.

Say your input requires 12.345 ( XX.XXX) and you mistakenly enter xx.cat . Can you format teh field to reject teh NON numeric part ??

(;-) TP


Hi Terry,

The code Balazs posted won't allow any input but 0-9 and one decimal. For retrieving it will be of no help, you would need a Regex script to remove.
Dan911
 
Posts: 181
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Re: Wizard toolpath solutions?

Postby Vmax549 » Sat Dec 02, 2017 6:06 pm

You Guys are correct I have been too long away from C# and UCCNC.

(;-) TP
Vmax549
 
Posts: 515
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Wizard toolpath solutions?

Postby Dan911 » Sun Dec 03, 2017 12:01 am

I guess the ole saying is true my Dad use to say to me " I forgot what you didn't learn yet"
Dan911
 
Posts: 181
Joined: Mon Oct 31, 2016 1:22 am
Location: USA

Previous

Return to Macros

Who is online

Users browsing this forum: No registered users and 2 guests