Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

CUI custom macro commands don't work in one file

CUI custom macro commands don't work in one file

Anonymous
Not applicable
1,819 Views
7 Replies
Message 1 of 8

CUI custom macro commands don't work in one file

Anonymous
Not applicable

Gday all,

 

Running LT 2015 and I have a few custom macro commands for inserting "text" with an incremental value after it, by mouse click.

 

Has been working fine for a while now on various files, but I have 2 files come from one project and the commands only don't work on one file.

 

I thought these were global commands for one, and secondly the incremental value increase, but the text just done't appear...

 

Any thoughts would be appreciated, both files use same setup, layer structure etc. and I've checked everything I have the knowledge to check, haha!

 

Thanks,

 

Examples:

 

Reset Start

^C^C_setvar;USERR1;-1;^c_setvar;USERR2;1;^c

 

Line A

*^c^c_text;\;;$M=$(getenv,StrPrefix)$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;USERR1;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));_setenv;STRPREFIX;$M=$(if,$(<,$(getvar,USERR1),8),"A0","A");

0 Likes
Accepted solutions (1)
1,820 Views
7 Replies
Replies (7)
Message 2 of 8

steven-g
Mentor
Mentor

The only difference I can see in the two images are the number of items, or is the problem that the last three items don't show in one file, In any event your script doesn't show any clues as to why there should be a problem, could you post the two drawing files, just strip out anything else so that only the text remains if neccessary, and make sure that the problem still occurs only in one file.

0 Likes
Message 3 of 8

pendean
Community Legend
Community Legend
Your wording of the problem is incomplete: "don't work" and "don't appear" really don't tell us much. Care to elaborate in a lot more detail??

OR.... just fix the one problem file: INSERT it into a working template file and test it again. It should work well now.
0 Likes
Message 4 of 8

Emmsleys
Alumni
Alumni

A few suggestions: 

 

If you insert or wblock that specific drawing into a new file does that make a difference? 



Sarah Emmsley
Technical Support Specialist

Message 5 of 8

Anonymous
Not applicable

Thanks for the replies so far, apologies if my information isn't complete.

 

WBLOCK entire drawing to new file had no effect, and stripping out the entire drawing to the one or two layers I needed the text to be on also made no difference

 

I'm actually not sure how to more clearly explain the issue, the two files are attached, you may need to check the CUI keyboard shortcuts to see the commands used.

 

But essentially, one example, CTRL + X is a "counter reset" and CTRL + A should on every mouse click mark A00, A01, A02 etc. always with an increment of 1, likewise CTRL + B should on every mouse click mark B00, B01 etc.

 

Then if I hit my max number of B63, CTRL + X resets the counter to -1 so I can start again from B00. You can also use CTRL + Z to set a specific start number or check the current counter number.

 

In the "Level 0" file these commands work correctly and in the "Level 1" the counter increments up but the text doesn't appear on the layer.

 

Thanks in advance.

0 Likes
Message 6 of 8

steven-g
Mentor
Mentor
Accepted solution

Look carefully at the text style in the 2 drawings. Set drawing level1 to have the same text height of "0" and everything works fine. By having a tekst height set in the tekst style it causes the tekst command in your macro to expect different inputs and stops the macro running properly.

 

EDIT: there is an undocumented variable in LT "macrotrace" if you set that to 1 then you get some helpfull output at the command line as the macro runs, it's not always clear but can show some usefull pointers.

Message 7 of 8

Anonymous
Not applicable

Thanks Steven,

 

I recall checking the text height, but only in the ribbon and not in the actual text options, appreciate you spending the time to find that difference!!

 

Will change MACROTRACE setting to one also and keep my eye out, thanks once again!

 

 

0 Likes
Message 8 of 8

steven-g
Mentor
Mentor

Glad it's sorted out, just a note the macrotrace variable is session based so you have to set it each time you will be using it, once you get used to how it works it's really usefull for debugging diesel macros.

0 Likes