Macro remove text block

Macro remove text block

Anonymous
Not applicable
1,751 Views
10 Replies
Message 1 of 11

Macro remove text block

Anonymous
Not applicable

Hi everyone, I have this simple macro to add a certain block of text on all the tool paths of an NC program which in this specific case is a programmed stop.
I would like to know if there is also a way with a macro to remove them all from the nc program.

0 Likes
Accepted solutions (1)
1,752 Views
10 Replies
Replies (10)
Message 2 of 11

lee_sanders
Alumni
Alumni

Hi @Anonymous 

 

This seemed to work for me

 

STRING Remove = INPUT ENTITY NCPROGRAM "Seleziona NcProgram"
ACTIVATE NCPROGRAM $Remove
EDIT NCPROGRAM $Remove REMOVE ITEM 1
EDIT NCPROGRAM $Remove REMOVE ITEM 2


Lee Sanders
Technical Consultant
0 Likes
Message 3 of 11

Anonymous
Not applicable

Hi, it doesn't work clear the text block but also the toolpath.
I was interested in erasing only the blocks of text.

0 Likes
Message 4 of 11

lee_sanders
Alumni
Alumni

Hi @Anonymous 

 

Can you share an example PM project?


Lee Sanders
Technical Consultant
0 Likes
Message 5 of 11

Anonymous
Not applicable

Yes

0 Likes
Message 6 of 11

lee_sanders
Alumni
Alumni

hi @Anonymous 

 

here is a workaround, this relies on the programs and text block being added sequentially.

I'm trying to get a more robust method

 

// count stores the number of programs in the NC program
INT count = 0
// counter is based on there being a text block before and after each program
INT counter = 0

STRING nc_program = INPUT ENTITY NCPROGRAM "Seleziona NcProgram"

// enter the number of programs in the NC program
string prompt = "Enter number of programs in NC"
$count = input $prompt
$count = $count *2

WHILE $counter < $count {
EDIT NCPROGRAM $nc_program REMOVE ITEM $counter
$counter = $counter + 2
}
// deletes last text block
EDIT NCPROGRAM $nc_program REMOVE ITEM $counter


Lee Sanders
Technical Consultant
0 Likes
Message 7 of 11

Anonymous
Not applicable

Hi, I tried your macro, also delete the nc programs together with the blocks of text.

0 Likes
Message 8 of 11

lee_sanders
Alumni
Alumni
Accepted solution

hi @Anonymous 

 

please try this below, this will remove ALL text blocks from the NC programs 

 

FOREACH $item in components(entity('ncprogram','')) {
if ($item.roottype=='nctextblock') {
EDIT TEXTBLOCK $item.Identifier REMFROMNCPROG
}
}

 


Lee Sanders
Technical Consultant
0 Likes
Message 9 of 11

Anonymous
Not applicable

Thanks, mythical works fine

0 Likes
Message 10 of 11

ksrinivas94GLE
Observer
Observer

can you please share any video clip ,this macro is not working to us.

0 Likes
Message 11 of 11

ksrinivas94GLE
Observer
Observer
CAN YOU SHARE THE PROCEDURE
0 Likes