Python - Show/Hide label preview

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
JasonWilliams
Valued Contributor
Posts: 37
Joined: Wed Aug 21, 2013 5:47 pm

Python - Show/Hide label preview

Post by JasonWilliams » Mon Sep 24, 2018 4:00 pm

I'm creating a form where you type in separate characters to create a "legend", which has up to four labels to be printed on.

in Python, how do I hide or show label previews, as the separate input boxes are typed in?

Many thanks.

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 144
Joined: Mon Aug 28, 2017 3:07 pm

Re: Python - Show/Hide label preview

Post by Kyleodonnell » Mon Sep 24, 2018 5:15 pm

Jason,

Which version of the software are you currently using? Please go to help>about in the software to find out.

JasonWilliams
Valued Contributor
Posts: 37
Joined: Wed Aug 21, 2013 5:47 pm

Re: Python - Show/Hide label preview

Post by JasonWilliams » Mon Sep 24, 2018 5:31 pm

Running PowerForms Suite 17.3

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 144
Joined: Mon Aug 28, 2017 3:07 pm

Re: Python - Show/Hide label preview

Post by Kyleodonnell » Mon Sep 24, 2018 6:56 pm

Jason,

You would be able to use the conditional visibility on preview
preview.JPG
preview.JPG (38.63 KiB) Viewed 142 times
Which you can tie something such as a python script to set the true or false value to show or hide the preview

You also have options for using actions such as "set object property"
actions.JPG
actions.JPG (35.58 KiB) Viewed 142 times
You would not need to use python to interact with the previews

JasonWilliams
Valued Contributor
Posts: 37
Joined: Wed Aug 21, 2013 5:47 pm

Re: Python - Show/Hide label preview

Post by JasonWilliams » Tue Sep 25, 2018 11:11 am

The "set object property" function worked perfectly; but how do you do this dynamically with Python? Something like "Preview_1.hide"?

Many thanks!

User avatar
Kyleodonnell
NiceLabel Support
NiceLabel Support
Posts: 144
Joined: Mon Aug 28, 2017 3:07 pm

Re: Python - Show/Hide label preview

Post by Kyleodonnell » Tue Sep 25, 2018 2:36 pm

Jason,

You can try that, however, the set object property can be tied to a variable and you can use the variable event's actions to show and hide a preview. So the preview would not show until an edit field is populated with a certain variable. What is the use case of using python to do this as the software can do it natively

Post Reply