Tutorial
Written using a Discussion Posting by Rajiv Agrawal
On the Pro/DESKTOP
CD there are many included VB applications that are not really documented.
This tutorial will explore the use of the CoffeeTime.bas application
which can be used to alter lighting inside of the Pro/D photo album.
*Note
that the CoffeeTIme.bas file found on this website has had a few
errors corrected in it. It is not the same as what is currently
on the Pro/DESKTOP CD
2. Run Pro/DESKTOP
3.
Browse out to the CoffeeTime.bas file with Windows File Explorer.
Drag-n-Drop CoffeeTime.bas into Pro/DESKTOP. When you drop CoffeeTime.bas
into Pro/DESKTOP the Visual Basic Editor will automatically run.
4. In the VB
Editor look in the object browser under Modules and you will find
the CoffeeTime module list there. Double click it to display the
VBA code.
The way
the code is written it will create an album rendering of the Coffee
assembly in the samples directory with colored lights. The code
is hard wired to the coffee assembly but we will show you how to
change that. We will dissect the CoffeeTime VB code after we see
how it works.
5. In the VB
Editor click File>Close & Return to Pro/Desktop
6. In Pro/DEKSTOP
click Tools>Macros
7. Make sure
you are looking for Macros in ProDESKTOP6, then select the CoffeeTime
Macro.
8. RUN
The Macro will
run loading the coffee assm and all of the design files that are
components in the assembly. The macro will then render the assembly
in the photo album.
To see the rendered
image, in Pro/D use:
Windows>Album1
You can see
that different colored lights have been added to the rendering.
Big Deal eh?
Well with some modifications to the macro you can add different
lighting to any assembly.
Tools>Macros>VB
Editor (not available in the album mode, you must be looking
at a design file)
Open up the modules folder in the object browser and double click
CoffeeTime to load up the macro
Scroll down
through the macro and you can find comments on how to alter this
macro.
This first is
the directory path to find the assembly in. Then below that is where
the assembly name is set in the variable NAME.
Keep going down
and you will find the area where materials are applied to each of
the individual components. If you want to change the assembly you
would have to change this to match the components in the new assembly
Just below you
will find where the lights are set up
First, you define
the colors for the graduated background via RGB values
Second, you
define the light colors via RGB Values
Third, you give
the defined lights a position and a direction to shine
Are you a
VBA Developer!! This could easily be turned into a great application
that offered the user a windows interface! COME ON! Someone out there
has the SKILL!