Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
josh.cowley.ctd
474 Views, 4 Replies

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

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

 



4 REPLIES 4
Message 2 of 5
Sean571
in reply to: josh.cowley.ctd

//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


Message 3 of 5
josh.cowley.ctd
in reply to: Sean571

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

Message 4 of 5

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
Bnuno608
in reply to: josh.cowley.ctd

Can you show a imagem hás exemplo?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report