Announcements

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

surfaces by color, with macro. Speed up

rob_carri
Advocate
Advocate

surfaces by color, with macro. Speed up

rob_carri
Advocate
Advocate

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
                }
}
0 Likes
Reply
Accepted solutions (1)
825 Views
3 Replies
Replies (3)

Anonymous
Not applicable

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.

Anonymous
Not applicable
Accepted solution

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! 

0 Likes

rob_carri
Advocate
Advocate

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"