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: 

Macro command to import a model

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
john_lute
889 Views, 4 Replies

Macro command to import a model

When I run the macro I receive a translator error. When I import the same file, without the macro, the translator works fine.

 

 


// Create a list of files located in a specific folder
string LIST files = list_files("files","M:\LUTEJ1_Toolpaths\PN_103006\L00020_Build_Creo")

// Select a file from the list
INT x = INPUT CHOICE $files "Choose the desired Folder"

// Define a variable that includes the name of the file selected for import
string filename = $files[$x]

// Review file name selected, for testing only
print $filename
Macro pause $filename


// Import model
IMPORT MODEL FILEOPEN $filename

Labels (1)
4 REPLIES 4
Message 2 of 5
rafael.sansao
in reply to: john_lute

change:

IMPORT MODEL FILEOPEN $filename

by:

IMPORT MODEL $filename

Rafael Sansão

EESignature

Message 3 of 5
john_lute
in reply to: rafael.sansao

Thank you for the help?

Message 4 of 5
brandond276RW
in reply to: john_lute

Do you know how i could modify this to select multiple files to batch import models?

Message 5 of 5

Use this macro made by @Anonymous 

 

If you get an unauthorized access error, you need to change your computer's policies to enable script execution: - Run "Windows Powershell" as administrator; - Type: Set-ExecutionPolicy Unrestricted - Press enter - Press Yes

Rafael Sansão

EESignature

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

Post to forums  

Autodesk Design & Make Report