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

Setup Sheets

Message 1 of 22
4598 Views, 21 Replies

Setup Sheets

Hello All,


In some older versions, it was possible to create the sheet directly to excel file. Does anyone know if it is possible to do this with the powermill 2017 today?

Thank you

Message 21 of 22
in reply to: ondrej.mikulec

Thank you

Message 22 of 22

@VitorMartinsAugusto wrote:



I made this macro as a small example:


// Macro to export NC data to Excel

// Open File
FILE OPEN "c:\temp\NC.csv" FOR WRITE AS "output"
// Cycle through the NC programs
FOREACH ncp IN folder('NCProgram') {
	// Create an empty list
	STRING List names = {}
	// Output NC Program name
	STRING nome = "NC Program:," + ncp.Name
	FILE WRITE $nome TO "output"
	// Output Header for Toolpath data
	STRING header = "Toolpath Name, Tool Name, Toolpath Length"
	FILE WRITE $header TO "output"
	// loop over the components in the nc program
	FOREACH item IN components(ncp) {
		// Check that it is a toolpath
		IF item.RootType == 'nctoolpath' {
			// Use MEMBER to check that we have not seen this name before
			IF NOT member(names, item.Name) {
				// Add name to list
				bool ok = add_last(names, item.Name)
				// Output data for current toolpath
				STRING line = item.Name + "," + item.Toolname.value + "," + string(item.Length.value)
				FILE WRITE $line TO "output"
			} else {

	// Write an empty line
	STRING empty_line = " "
	FILE WRITE $empty_line TO "output"
// Close File	
FILE CLOSE "output"

Hope this helps and is what you were looking for.


You can add a custom toolbar and link this macro to a button. Instead of using the setup sheets functionality, just click the button and you get a CSV file with the relevant information. All that is needed is contained in this macro.


Of course you can add other toolpath parameters for each line.


Some improvements are necessary:


1) You need to change how the filename is selected. You could replace the static name by a user input or, better, just name it with the project's name.

2) You need to change the folder: either keep a static folder like C:\Temp, which would be accessible for all users to link with Excel or use the project path.




That code works great but how would I add the Tolerance and thickness from the ncprograms  to it ?  

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report