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: 

powerimill message window

9 REPLIES 9
SOLVED
Reply
Message 1 of 10
11450437
667 Views, 9 Replies

powerimill message window

My macro outputs some information to this kind of window. I change the name of the tool or the information on this window disappears. How can I keep it all the time?

 

11450437_0-1709429849024.png

 

9 REPLIES 9
Message 2 of 10
TK.421
in reply to: 11450437

see this thread for infobox information. should have everything you need!

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 3 of 10
11450437
in reply to: TK.421

Thank you for your help, but I don't seem to find what I want. My macro is to verify the information in batches and output it to infobox information. After the macro runs, I will manually change the name and length of the knife, but the information on infobox will be cleared when I manually change the name of the knife.
Message 4 of 10
TK.421
in reply to: 11450437

You need to capture the existing text in the info box as a string. I think there’s a couple examples in that link and the link in that thread. If you still are having trouble, I can look in the morning when I get to work, I’ll post up my code

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 5 of 10
11450437
in reply to: TK.421

But, my macro is finished.
Message 6 of 10
TK.421
in reply to: 11450437

You can write the current text to a file and then recall it from there, and when you make your change, refresh the box information via another macro

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 7 of 10
11450437
in reply to: TK.421

Thank you. The text color in the information box is different. Can I keep the original color in the rewritten text? Can you write a similar macro for my reference?
Message 8 of 10
TK.421
in reply to: 11450437

i copied the macro i use for my project notes and threw in an example of writing to and reading from a text file.

 

This is very sloppy and you'll have to play around with it to clean it up, but this is where I was going with this

    // Variables for the info box message
	STRING existing = ""
    STRING msg = ""
	STRING notes = project.notes

	// set the temp file location
	STRING filePath = "C:/temp/temp.txt"

	// open the temp file and read any existing notes
	FILE OPEN $filePath FOR READ AS "file1"
	FILE READ $existing FROM "file1"
	FILE CLOSE "file1"

	// Create my info box & write the
	// formatting example
	INFOBOX NEW "Project Notes & User Parameters"
	INFOBOX STYLE "Normal"

	STRING s = "Project Notes" + crlf
	INFOBOX STYLE "Warning"
	INFOBOX STATE "Bold" TRUE
	INFOBOX STATE "underline" TRUE
	INFOBOX APPEND $s
	INFOBOX STATE "underline" FALSE
	INFOBOX STATE "Bold" FALSE
	// append the existing notes to whats in the file
	$notes = $notes + $existing
	INFOBOX APPEND $notes



	// Write the existing info to a text file
	FILE OPEN $filePath FOR WRITE AS output
	FILE WRITE $notes TO output
	FILE CLOSE output
--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
Message 9 of 10
11450437
in reply to: TK.421

Thank you for your help. It's perfect.
Message 10 of 10
TK.421
in reply to: 11450437

glad it helped!

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie

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

Post to forums  

Autodesk Design & Make Report