View Single Post
  #2  
Old 12-21-2007, 09:54 AM
Andy Poulsen Andy Poulsen is offline
Administrator
 
Join Date: Apr 2003
Location: Fort Collins, Colorado
Posts: 273
Re: Lisp tool for coloring ALMOST perfect...

Hi Jaap,

I believe this will do the trick for you:
Code:
(progn
  (ELAN::SET_PART_COLOR (OLI::SD-INQ-CURR-PART) :RGB
    (FRAME2::GPNT3D (LISP::RANDOM 1.0) (LISP::RANDOM 1.0)
        (LISP::RANDOM 1.0))
    :DONE)
  (update_screen))
You just need to tell OSM to update the screen (which clicking in the viewport will also do).

The other thing to note is that when you assign code to a button, it expects a single command, which is why the "progn" statement (along with its closing parenthesis) is needed -- the (progn ...) statement allows your color randomizer and the update_screen call to be passed as a single command to the customization interface. (I know you're aware of what (progn ...) does, but maybe this will help some others who are just getting started!)

I hope this helps!

Merry Christmas and Happy New Year everyone!

andy
__________________
Andy Poulsen
AI MAXTools: Dream. Design. Done. It's that easy!
Add-ins bringing new functionality and speed to Creo Elements/Direct and CoCreate products. Now available for v17-v20+!
See them in action at www.ai-maxtools.com and then try them for yourself -- FREE!
Reply With Quote