Need Help With Macro to add notes to nc program set up sheet

Need Help With Macro to add notes to nc program set up sheet

josh.cowley.ctd
Contributor Contributor
793 Views
4 Replies
Message 1 of 5

Need Help With Macro to add notes to nc program set up sheet

josh.cowley.ctd
Contributor
Contributor

Can anyone help and explain to me what I'm doing wrong here? I am defiantly a macro noob and really want to get better at them.

 

I am working on a macro to write my datum locations to the nc program notes so I don't have to retype it every job for the guys in the shop to get more clarification of location

 

 

DIALOGS MESSAGE OFF
DIALOGS ERROR OFF

//CREATES SELECTABLE OPTIONS IN A USER INPUT WINDOW
STRING ARRAY A[] = {"Top","Centered","Bottom"}

//NAME OF USER INPUT WINDOW
INT Z = INPUT CHOICE $A "Select Z Location?"

//CHOOSES Z OPTION 1
if $z == 0 {
TOP


//CHOOSES Z OPTION 2
} elseif $z == 1 {
CENTER


//CHOOSES Z OPTION 3
} elseif $z == 2 {
BOTTOM

 


EDIT NCPROGRAM $active_NCPROGRAM NOTES "Z"    HOW DO I GET THIS LINE TO WRITE THE CHOSEN TEXT FROM $z VARIABLE

 

DIALOGS MESSAGE ON
DIALOGS ERROR ON

 

If anyone would lend their expertise I would be grateful 

Thank You

 



0 Likes
Accepted solutions (1)
794 Views
4 Replies
Replies (4)
Message 2 of 5

Sean571
Advocate
Advocate
Accepted solution
//CREATES SELECTABLE OPTIONS IN A USER INPUT WINDOW
STRING ARRAY A[] = {"Top","Centered","Bottom"}

//NAME OF USER INPUT WINDOW
INT Z = INPUT CHOICE $A "Select Z Location?"

// Create Build the Note as a string
STRING ncNotes = "Z " + $A[$Z]

// Set the notes equal to the $ncNotes variable
EDIT NCPROGRAM ; NOTES $ncNotes 
Sean Wroblewski
Applications Engineer

0 Likes
Message 3 of 5

josh.cowley.ctd
Contributor
Contributor

Thank you very much for your assistance!!! I greatly appreciate it!

0 Likes
Message 4 of 5

josh.cowley.ctd
Contributor
Contributor

For anyone interested, here is the final result. This will add your datum location to the ncprogram user defined notes, which will show in your set up sheets

 

Thanks again Sean for your help!

 

//Adds notes to "NCPROGRAMS USER DEFINED NOTES"

EDIT PAGE NCPROGRAMNOTES1

QUIT FORM NCPROGRAMNOTES

 


//CREATES X

//CREATES SELECTABLE OPTIONS IN A USER INPUT WINDOW
STRING ARRAY A[] = {"Left","Center","Right"}

//NAME OF USER INPUT WINDOW
INT X = INPUT CHOICE $A "Select X Location?"

// Create Build the Note as a string
STRING ncNote1 = "X " + $A[$X]

 

//CREATES Y
//CREATES SELECTABLE OPTIONS IN A USER INPUT WINDOW
STRING ARRAY B[] = {"Front","Center","Back"}

//NAME OF USER INPUT WINDOW
INT Y = INPUT CHOICE $B "Select Y Location?"

// Create Build the Note as a string
STRING ncNote2 = "Y " + $B[$Y]

 

 

//CREATES Z
//CREATES SELECTABLE OPTIONS IN A USER INPUT WINDOW
STRING ARRAY C[] = {"Top","Centered","Bottom"}

//NAME OF USER INPUT WINDOW
INT Z = INPUT CHOICE $C "Select Z Location?"

// Create Build the Note as a string
STRING ncNote3 = "Z " + $C[$Z]

 

 


// ADDS MULTIPLE VARIBLES TOGETHER FOR FINAL STRING
STRING ncNotes = $ncNote1+","+" "+ncNote2+","+" "+ncNote3

// Set the notes equal to the $ncNotes variable
EDIT NCPROGRAM ; NOTES $ncNotes

 

 

Message 5 of 5

nubrandao
Collaborator
Collaborator

Can you show a imagem hás exemplo?

0 Likes