Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

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: 

surfaces by color, with macro. Speed up

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
rob_carri
820 Views, 3 Replies

surfaces by color, with macro. Speed up

Hi everyone
Does anyone think of it because it takes so long to make a color change of the selected surfaces, using this macro? How can I speed it up?
thanks

 

FOREACH $Mod IN FOLDER('model') {
    IF number_selected($entity('model',$Mod.name).components) > 0 {
                                EDIT MODEL $Mod.name COLOUR RGB 1.00000 0.50196 0.00000
                }
}
3 REPLIES 3
Message 2 of 4
Anonymous
in reply to: rob_carri

I'm unable to do any tests right now but, off the top of my head, what might speed this up is to disable the graphics updating at the beginning of the macro and enable it again at the end. It does exactly as it sounds, it won't show any changes to the screen while the macro is running and only shows the final results once it's turned back on.

 

To turn off and on the graphics use:

// Stop the screen from updating while we do a lengthy process
GRAPHICS UNLOCK

// We're all done so tell PowerMILL it can update itself
GRAPHICS LOCK

Hopefully that will speed it up since it won't have to redraw the viewport for each surface selected.

Message 3 of 4
Anonymous
in reply to: Anonymous

I'm an idiot. I got the above reversed. "GRAPHICS LOCK" stops the viewport from updating and "GRAPHICS UNLOCK" allows the viewport to update.

 

Sorry about that! 

Message 4 of 4
rob_carri
in reply to: Anonymous

oh yeah....

 

its a perfect, thnaks

 

GRAPHICS LOCK
FOREACH $Mod IN FOLDER('model') {
    IF number_selected($entity('model',$Mod.name).components) > 0 {
                                EDIT MODEL $Mod.name COLOUR RGB 0.00000 0.50196 0.75294
                }
}

GRAPHICS UNLOCK

message info "Fin color"

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

Post to forums  

Autodesk Design & Make Report