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: 

Problem with Macro to load triangle block definition

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
Jason_McDaniel
332 Views, 6 Replies

Problem with Macro to load triangle block definition

Hello. I'm not sure of the correct syntax I need to get this to work. I'm trying to write a macro to load an exported ViemMill model as block.

 

FORM BLOCK
EDIT BLOCKTYPE TRIANGLES

// Open Import Browser
STRING $VarModel = ''
$VarModel = FILESELECT "Please select a exported ViewMill state file"


// Load exported ViewMill state model as new Block
GET BLOCK FILEOPEN $VarModel


EDIT BLOCK COORDINATE WORLD
DRAW BLOCK
BLOCK ACCEPT

 

I'm getting the following error: "Unable to open block definition file '$VarModel' from line 10.

What am I doing wrong?

 

Thank you,

Jason

Labels (3)
6 REPLIES 6
Message 2 of 7
iamcdn79
in reply to: Jason_McDaniel

Try 

 

 

FORM BLOCK
EDIT BLOCKTYPE TRIANGLES

// Open Import Browser
STRING $VarModel = ''
$VarModel = FILESELECT "Please select a exported ViewMill state file"


// Load exported ViewMill state model as new Block
GET BLOCK $VarModel


EDIT BLOCK COORDINATE WORLD
DRAW BLOCK
BLOCK ACCEPT

 


Intel Core i9 13900KF CPU
128 GB Kingston Beast DDR4 SDRAM
PNY RTX A2000 6GB Video Card
WD 1 TB SSD Hard Drive
Windows 11 Pro

Message 3 of 7

Try this....

 

FORM BLOCK
EDIT BLOCKTYPE TRIANGLES
EDIT BLOCK COORDINATE WORLD
// Open Import Browser
STRING $VarModel = ''
$VarModel = FILESELECT "Please select a exported ViewMill state file"

// Load exported ViewMill state model as new Block
GET BLOCK $VarModel
BLOCK ACCEPT

Message 4 of 7

This works. Thank you. 🙂
Message 5 of 7
Jason_McDaniel
in reply to: iamcdn79

This works. I don't know why I thought I needed the FILEOPEN command there. Thank you. 🙂
Message 6 of 7

FILEOPEN raises the file browser and puts you into a state where PowerMill variables aren't known. I would recommend not using FILEOPEN FILESAVE when writing macros unless you really want the user to interact with the file system via the browser.

Message 7 of 7

Good to know. Thank you.

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report