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 help to use active work plane instead of named work plane

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
josh.cowley.ctd
211 Views, 4 Replies

Macro help to use active work plane instead of named work plane

I am trying to change a macro to use the active work plane instead of the named work plane.

I have this line 

EDIT SETUP SAFEAREA WORKPLANE "1"

 

I can't seem to find in the guide how to change it so instead of setting the work plane by name "1", it will set safe area work plane to the one that is active?

 

 

Thanks for any help you can provide.

4 REPLIES 4
Message 2 of 5
iamcdn79
in reply to: josh.cowley.ctd

Try this 

 

STRING active_workplane = ""
IF ENTITY_EXISTS('workplane', "") {
   $active_workplane = $ENTITY('workplane', '').name
}
EDIT SETUP SAFEAREA WORKPLANE $active_workplane

 


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 5
josh.cowley.ctd
in reply to: iamcdn79

That works exactly as I needed, Thank you!!!

 

If you wouldn't mind could you possibly add a comment for each line with description of what it actually does? 

It would really help me wrap my brain around what the command is doing to help with creating future macros on my own?

Message 4 of 5
iamcdn79
in reply to: josh.cowley.ctd


 

// Declare a string variable named "active_workplane" and initialize it to an empty string
STRING active_workplane = ""

// Check if an active workplane exists
IF ENTITY_EXISTS('workplane', "") {
   // If the active workplane exists, assign it to the "active_workplane" variable
   $active_workplane = $ENTITY('workplane', '').name
}

// Edit the setup safe area workplane to be the "active_workplane"
EDIT SETUP SAFEAREA WORKPLANE $active_workplane
​

 

 

 

 


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 5 of 5
josh.cowley.ctd
in reply to: iamcdn79

Thank You Very Much!!!

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report