Macro command to import a model

Macro command to import a model

john_lute
Enthusiast Enthusiast
1,744 Views
4 Replies
Message 1 of 5

Macro command to import a model

john_lute
Enthusiast
Enthusiast

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

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

rafael.sansao
Advisor
Advisor
Accepted solution

change:

IMPORT MODEL FILEOPEN $filename

by:

IMPORT MODEL $filename

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

0 Likes
Message 3 of 5

john_lute
Enthusiast
Enthusiast

Thank you for the help?

0 Likes
Message 4 of 5

brandond276RW
Community Visitor
Community Visitor

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

0 Likes
Message 5 of 5

rafael.sansao
Advisor
Advisor

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

OptiNC - www.optinc.tech

EESignature

0 Likes