Using cut data for Variable Text from the Lightburn project file

I wanted to have text on wood veneer I cut which gave the salient Cutting parameters that had been used. The two reasons are:

  • It gives me a record of the cutting values used since these are written on a waste area
  • I can see these using the Play function which gives a quick check that all is as required.

The Variable Test feature has an option Cut Setting. However not all the values I wanted to see are available. The web address is Variable Text Formatting - LightBurn Documentation (lightburnsoftware.com)

The variable text feature also has an option Merge/CSV. This allows data to be read from a csv file. This file is read before each time either Play or the Variable Text Test functions are used. Lightburn helpful Support Staff commented that all the data I want is in the LightBurn project file. So I have written a Perl Tk script which:

  • Allows the user to select a directory in which the current Lightburn files is stored
  • Periodically scans this directory to see if a Lightburn project file has been stored since the last scan
  • If it has, writes a structured csv file that extracts the cutting data from the Lightburn file.

The picture below shows the GUI for the Perl script.
Perl Lighburn gui
The buttons allow a directory to be selected or the last directory used to be scanned (the last directory used is written to a file so that it is available the next time the Perl is used). Details are given of the current directory and the Lightburn file used.
Two other buttons allow

  1. the scanning process to be stopped so that, for example, another Lightburn directory can be selected
  2. the Perl to be closed down

The time interval between scans also can be set by the user.
A file stores the names of the Lightburn data to be written into the csv file and the column in which the data is shown.
A second file allows selected data to be changed. For example if Tabs are not used nothing is shown in the written csv file. When tabs are used a figure 1 is shown. These are changed to No and Yes respectively. Similarly, if kerf is not set nothing is given in the Lightburn file. In this case a value of 0.0 is written.
A list is given of any data names found which are not allowed for at the end of the written csv file. This allows the name data file to be edited.

The next picture shows A Lightburn screen with the Variable text written, objects using two different layers.


The next picture shows the Variable Text using the data from the csv file written for this project. The file store button has to be used before text with the latest setting can be seen.
Lighburn screen play a 50pc
I will be interested to see in any comments about this.

Hi Henry, it is a fine initiative and definitely useful.
I myself use the “built-in” function from variable text but missed some parameters.
It is probably individual how people want/can use this function.
I have saved a small textbox with the variable text parameters in my art library, which I set on some projects.

In LB’s variable text version for process data, I am missing min.power and kerf settings variables.
As a non-programmer, I think that LB will be able to expand variable text for process parameters with some of the important parameters that are missing, without it costing an arm or a leg.
I also believe that it is on the list in the future suggestions department :wink:
But if your proposed solution is easy to use in and with LB, then that is also very welcome with me.

Thank you for your positive comments.
I believe it is easy to use (but I guess I would as I wrote it). However, you do need Perl with Perl Tk. If you have this I am content to send you the files etc on an ‘as seen’ basis with no guarantees etc that it will do what you want and not cause other problems.

Thanks Henry, but I’ve never had anything to do with Perl, so if it’s not something that can be “installed” very simply in Ubuntu and or Mac OS, then I’m lost :wink: and I’ll have to wait for the LB people to upgrade this function in variable text.

.hmm I do see your problem. I have ‘googled’ Perl for both Ubuntu and Mac-OS and there seem to be several sites which explain how Perl can be installed on these operating systems. So it may be worth trying one of these. You will want Perl 5 including Tk. Tk is the module that gives the GUI part of the application. I wish I could help more but I have no experience of either of these operating systems.

I asked a Perl support group about the possibilities etc of installing/accessing Perl on Ubuntu and MAC OS. The three replies are below. They may be of some help.

Answer A

Ubuntu:

sudo apt install perl perl-tk

You could also install your own Perl using perlbrew. This is great if you’re in a shared environment, if you better control over the versions of Perl and modules, or if you want to install modules which aren’t provided by your system’s package manager.

curl -L https://install.perlbrew.pl | bash
perlbrew install 5.40.0
cpan Tk

Don’t forget to add to your shell’s startup script as directed.

Answer B

Although I’ve never used the Ubuntu distro(s), any Linux (or Unix) or Mac OSX I’ve used, already had Perl installed.
Not sure about Tk, never used it, but it should be installable from the std repos on Linux .

Answer C

As far as I know both have Perl installed by default. There are ways to install different versions of Perl on MacOS and switch between them but that is another matter.

Open the terminal and enter,

perl -v

Ubuntu 24.04 aka Noble Numbat has Perl version 5.38.2 installed by default. There are some modules in place already, but when you add more it pays to make every effort to get the modules from the official repositories before turning to CPAN itself.

As for MacOS, I have not used that for years but homebrew would be the way to add any missing modules before turning to raw CPAN.

thanks for your effort, I’m running Linux/LB on my workshop/laser computer and would like to give it a try.

OK - will be good to hear how you get on.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.