03-05-2024
08:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
03-05-2024
08:55 AM
Hello, I would like to get some data into the program and it occurred to me that "job-notes" (according to the picture) is a good option.
I need to get the data into two lines (it's in the code), but as shown in the picture. The current form is repeated 2 times for me, and I would have to remove 2 lines. The code is as follows:
if (hasGlobalParameter("job-notes")) {
var notes = getGlobalParameter("job-notes");
if (notes) {
var lines = String(notes).split("\n");
for (line in lines) {
var comment = lines[line].replace(/^\s+|\s+$/gm,'');
if (comment) {
writeBlock("*-material:" + (comment))
writeBlock("*-zmena:" + (comment))
}
}
}
}
if (programComment) {
writeBlock("*-poznamka:" + (programComment))
} else {
writeBlock("*-poznamka:");
}
The current output is like this (it's wrong)
1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:11523
7 *-material:A
8 *-zmena:A
9 *-poznamka:
10 *-datum: utery, 5. brezna 2024
The output should be like this:
1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:11523
6 *-zmena:A
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024
If I don't enter any data in the notes, the output should be like this:
1 BLK FORM 0.1 Z X-24 Y-24 Z-150
2 BLK FORM 0.2 X+24 Y+24 Z+0
3 CYCL DEF 32.0 TOLERANCE
4 CYCL DEF 32.1 T0.02
5 *-material:
6 *-zmena:
7 *-poznamka:
8 *-datum: utery, 5. brezna 2024
I enter the data here:
Thanks
Solved! Go to Solution.
Fusion