Teaching a model with UI Builder

Tips and tricks for Adept ACE

Teaching a model with UI Builder

Postby marcoshayama » Thu Dec 29, 2016 6:12 am

Hi everyone!

Would it be possible to link a UI Form button with the button “New Image” from some “Locator Model” vision tool?

Basically I would like to, with a simple click on a button, acquire a new image with the Locator Model tool – replacing the old existing one – and automatically teach the features on this image with certain pre-configured parameters.

Thanks!
marcoshayama
 
Posts: 6
Joined: Thu Mar 22, 2012 10:09 am

Re: Teaching a model with UI Builder

Postby stephano » Mon Jan 02, 2017 3:28 am

Hello,

you can add the complete editor control for the locator model you want to change to your UI Form:

Code: Select all
ILocatorModel locatorModel = (ILocatorModel) ace["/Locator Model"];
Control locatorModelEditor = ObjectEditorAttribute.CreateEditorControl(aceClient, locatorModel);

Please replace "/Locator Model" with the name of the model in your workspace.

If you want to implement just the "New image" button, have a look at the "ILocatorModel Interface" in the ACE Reference Guide.
There is a code example that shows how to create a new model.

HTH,
Stephan
stephano
 
Posts: 23
Joined: Fri Aug 09, 2013 12:49 am

Re: Teaching a model with UI Builder

Postby stephano » Mon Jan 02, 2017 8:21 am

One additional thing:

You can use the teach wizard as well to teach a new locator model:

Code: Select all
ILocatorModel locatorModel = (ILocatorModel) ace["/Locator Model"];
ILocatorTool locatorTool1 = (ILocatorTool) ace["/Locator"];      
bool wasModelCreated = VisionToolTeachUtil.TeachLocatorModel(this, aceClient, locatorTool1, ref locatorModel);      


teachwizard.PNG
teachwizard.PNG (79.89 KiB) Viewed 4436 times
stephano
 
Posts: 23
Joined: Fri Aug 09, 2013 12:49 am

Re: Teaching a model with UI Builder

Postby marcoshayama » Mon Jan 23, 2017 3:50 am

Awesome...

Thank you very much!
marcoshayama
 
Posts: 6
Joined: Thu Mar 22, 2012 10:09 am


Return to Adept ACE

Who is online

Users browsing this forum: No registered users and 2 guests

cron