![]() |
|
#1
|
||||
|
||||
|
Lisp tool for coloring ALMOST perfect...
Hi,
By using Tools > Customize > New.... I made a simple button in OSD that will give the Active Part a random color each time I click it. Saves some time when doing a quick and dirty modeling job ![]() It works great, except for the fact that I have to click in the Viewport before anything happens. So, I press my new button AND click somewhere in the Viewport, and then my Active Part has a new color. Is there a trick to make the button work without the 2nd click??? Here's the code that's used in the button: Code:
(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)
Regards, Jaap |
|
#2
|
|||
|
|||
|
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))
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 Aspiration Innovation, Inc.: Dream. Design. Done. AI MAXTools: It's that easy! Visit the all-new www.ai-maxtools.com for more information. |
|
#3
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Hi,
YES!! This is working perfectly :-) Thanks! Regards, Jaap |
|
#4
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Jaap
Out of curiosity, what is Elan: used for? What does it mean. Thanks Tom
__________________
Tom Kirkman OSM 16.50B and Model Manager 16.00F on Lenovo ThinkStation |
|
#5
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Quote:
Claus
__________________
CoCreate Modeling FAQ: http://www.clausbrod.de/CoCreateModeling/ |
|
#6
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Quote:
so: PHP Code:
__________________
|
|
#7
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Thanks
This clears up several other lisp programs I had questions with. Tom
__________________
Tom Kirkman OSM 16.50B and Model Manager 16.00F on Lenovo ThinkStation |
|
#8
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Hi,
thanks Wolfgang, now I understand it myself ![]() It was recorded in the Tools > Customize menu, indeed, because I knew from earlier experiments that some of the package specifications seem to be necessary. Kind regards, Jaap |
|
#9
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
To colorize all parts within an assembly, or a selected set of parts, by using a random color (or one set) there an old and a new tool available at http://osd.cad.de/index.en.htm
Have a look to
__________________
|
|
#10
|
||||
|
||||
|
Re: Lisp tool for coloring ALMOST perfect...
Hi,
that's a nice tool! We use a tool that's very similar, but your tool has more options. Thanks for the hint! Kind regards, Jaap |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|