[Books]

Creo Elements/Direct 3D Library


Icon Integration - How To

How to integrate Icons in Creo Elements/Direct 3D Library 8.0 and earlier Versions


How to get and integrate user defined icons into the 3D Library user interface

All icons used in 3D Library are organized in different categories. These categories are reflected in the directory structure on harddisk and also in the user interface. The file format of the icon file can be every type which is supported by Creo Elements/Direct Modeling Integration-Kit Function sd-create-image (see online documentation, integration kit). Icons shipped on the 3D Library catalog CD are saved in XBM format.

The icon categories are:
MAIN
The highest level in 3D Libray part structure
EZT
The second level in 3D Libray part structure
PART
The third level in 3D Libray part structure. These level specifies a standard part as known by the DIN / ISO / AMSE organizations
VIEW 1)
The view category was used to have a represantaion how the part looks in 2D standard view of a drawing
SML
This category shows specific parameter of the selected standard part

REMARK:
1) The icons of the VIEW category are not required since Version SD8.x. For compatibility reason they were still included in the catalog CD of SolidDesigner 8.0.

We will start now with an overview having a look to the user interface, the icons used there and where they are located. Then we will have a closer look to an icon index file and finally do a step by step integration of some new icons


What is Where?

User Interface

User Interface looks like
Level

 
Reference

Icon will be referenced in
Location

Icon is located in
click to enarge

MAIN

(any name)

MAIN_EZT.IDX

For example:
.../sldiniso_eng/SolidLib/icon/MAIN_EZT.IDX

MAIN@Bolt/Screw@MAIN/din_main.13@0

EZT@Cheese Hd Screw@EZT/din_ezt.110@0

icon/MAIN/din_main13
click to enarge

EZT

(any name)

MAIN_EZT.IDX

For example:
.../sldiniso_eng/SolidLib/icon/MAIN_EZT.IDX

MAIN@Bolt/Screw@MAIN/din_main.13@0

EZT@Cheese Hd Screw@EZT/din_ezt.110@0

icon/EZT/din_ezt.110
click to enarge

PART

(classcode).001

Classcode.IDX

For example:
.../slexample_.../slcatalog/icon/DIN00964.IDX

PART@D00964@PART/D00964.001@0
SML@D00964@SML/D00964.004@0
SML@D00964@SML/D00964.005@0
SML@D00964@SML/D00964.006@0
SML@D00964@SML/D00964.007@0
SML@D00964@SML/D00964.008@0
SML@D00964@SML/D00964.009@0
SML@D00964@SML/D00964.010@0
SML@D00964@SML/D00964.011@0
VIEW@D00964@VIEW/D00964.002@4@ans@2@anv@1@ebz@1@dsg@S
VIEW@D00964@VIEW/D00964.003@4@ans@4@anv@1@ebz@1@dsg@S


icon/PART/D00964.001
click to enarge

SML

(classcode).004
(classcode).005
(classcode).006
(classcode).007
(classcode).008
(classcode)...

Classcode.IDX

For example:
.../slexample_.../slcatalog/icon/DIN00964.IDX

PART@D00964@PART/D00964.001@0
SML@D00964@SML/D00964.004@0
SML@D00964@SML/D00964.005@0
SML@D00964@SML/D00964.006@0
SML@D00964@SML/D00964.007@0
SML@D00964@SML/D00964.008@0
SML@D00964@SML/D00964.009@0
SML@D00964@SML/D00964.010@0
SML@D00964@SML/D00964.011@0
VIEW@D00964@VIEW/D00964.002@4@ans@2@anv@1@ebz@1@dsg@S
VIEW@D00964@VIEW/D00964.003@4@ans@4@anv@1@ebz@1@dsg@S


icon/SML/D00964.004
icon/SML/D00964.005
icon/SML/D00964.006
icon/SML/D00964.007
icon/SML/D00964.008
icon/SML/D00964.009
icon/SML/D00964.010
icon/SML/D00964.011

only in SolidLibray versions <8.0

VIEW

(classcode).002
(classcode).003

Classcode.IDX

For example:
.../slexample_.../slcatalog/icon/DIN00964.IDX

PART@D00964@PART/D00964.001@0
SML@D00964@SML/D00964.004@0
SML@D00964@SML/D00964.005@0
SML@D00964@SML/D00964.006@0
SML@D00964@SML/D00964.007@0
SML@D00964@SML/D00964.008@0
SML@D00964@SML/D00964.009@0
SML@D00964@SML/D00964.010@0
SML@D00964@SML/D00964.011@0
VIEW@D00964@VIEW/D00964.002@4@ans@2@anv@1@ebz@1@dsg@S
VIEW@D00964@VIEW/D00964.003@4@ans@4@anv@1@ebz@1@dsg@S


icon/VIEW/D00964.002
icon/VIEW/D00964.003




Where's the icon?

The 3D Library is using INDEX files to get the right icon to be displayed.

Icon index files are located in the .../slcatalog/icon directory and one in the .../SolidLib/icon directory. Icon index files are simple ascii files and can be edited with every text editor saving plain text files. Each line in the index files treats one icon. There in is listed the purpose where to use this icon, a string which makes the connection to the EZT.TAB (see online documentation) and finally the filename inclusive a path relative to the .../slcatalog/icon directroy.

 

    part@D00964@part/D00964.001@0

      |     |     |      |___________filename = classcode(DOT)number
      |     |     |                                with number 001:    used for purpose PART
      |     |     |                                with number 002,003 used for purpose VIEW
      |     |     |                                with number 004,nnn used for purpose SML
      |     |     |__________________subdir
      |     |________________________string to recognize / classcode
      |______________________________purpose



Step by Step!

To get a template for the icon it is a good idea to make an Annotation drawing of your 3D Model or to project the 3D Model in Creo Elements/Direct Modeling to a workplane to get some 2D geometry. Then to make a screenshot, may be to prepare these screenshots and save them under the required name. Later the icon index file has to be edited/created to reflect the new existing icons and make them available to the user interface of 3D Library.
  1. Create an Annotation drawing with some views. Modfiy the geometry to be not too complex.

  2. Create / edit the dimension on the views, which been like to see on the icon and or add some text.


  3. Create screenshots from all your icons and save these under specific filenames.

    Finally you should have the following pixmap files in/below the icon dir

           5108 Aug 18 1998 MAIN/din_main.13
           5108 Aug 18 1998 EZT/din_ezt.110
           5028 Apr 3 08:00 PART/DIN00964.001
           5108 Aug 18 1998 SML/DIN00964.004
           5108 Aug 18 1998 SML/DIN00964.005
           5108 Aug 18 1998 SML/DIN00964.006
           5108 Aug 18 1998 SML/DIN00964.007
           5108 Aug 18 1998 SML/DIN00964.008
           5108 Aug 18 1998 SML/DIN00964.009
           5108 Aug 18 1998 SML/DIN00964.010
           5108 Aug 18 1998 SML/DIN00964.011
           5108 Aug 18 1998 VIEW/DIN00964.002
           5108 Aug 18 1998 VIEW/DIN00964.003
    


  4. Activate an other application (e.g. Paint / Xpaint) however you can handle the icons. References: change size of icon to width 80pixel and height 80pixel, background white, all geometric lines: black.

    The icons look like

    MAIN/din_main.13
    EZT/din_ezt.110
    PART/D00964.001
    PART/D00964.004
    PART/D00964.005
    PART/D00964.006
    PART/D00964.007
    PART/D00964.008
    PART/D00964.009
    PART/D00964.010
    PART/D00964.011

    REMARK:
    Of course, you can also use your favorite grafik tool to create icons from scratch or to modify them.

  5. Create a classcode.IDX file

    Take an existing IDX file as a template and edit that one or use one of the tools below.

    e.g.: .../sldiniso_eng/slcatalog/icon/DIN00964.IDX

    Content:

    PART@D00964@PART/D00964.001@0
    SML@D00964@SML/D00964.004@0
    SML@D00964@SML/D00964.005@0
    SML@D00964@SML/D00964.006@0
    SML@D00964@SML/D00964.007@0
    SML@D00964@SML/D00964.008@0
    SML@D00964@SML/D00964.009@0
    SML@D00964@SML/D00964.010@0
    SML@D00964@SML/D00964.011@0
    VIEW@D00964@VIEW/D00964.002@4@ans@2@anv@1@ebz@1@dsg@S
    VIEW@D00964@VIEW/D00964.003@4@ans@4@anv@1@ebz@1@dsg@S
    


  6. Create / modify your MAIN_EZT.IDX file to add the lines
    MAIN@Bolt/Screw@MAIN/din_main.13@0
    EZT@Cheese Hd Screw@EZT/din_ezt.110@0
    
    to your MAIN_EZT.IDX file. The string between the first and the second "@" has to refer to the string defined for level 1 and 2 in the administration area of 3D Library's user interface.

    -rw-r--r-- 1 bin bin 94 Apr 3 08:00 ./SolidLib/icon/MAIN_EZT.IDX

    REMARK:
    There is a second one with the same filename which is only used during the catalog installation by the installation scripts.
    -rw-r--r-- 1 bin bin 94 Apr 3 08:00 ./slcatalog/icon/MAIN_EZT.IDX
    Do not edit this one.

  7. Activate your 3D Library to see your own icons in the user interface now.
That's all.

Tools

If you locate and name your icon files as shown above you can use the following scripts to generate the icon index file

for HP UX systems, save as makeicon
#!/bin/ksh
#  -*-awk-*- force emacs to awk mode
# ###############################################################################
#
#               Parametric Technology GmbH Confidential
#
# Description:  script to generate an icon index file
# Author:       Wolfgang Traetner
# Created:      Wed Sep 13 07:27:06 2000
# Modified:     
# Language:     ksh
#
# (C) Copyright 2000 Parametric Technology GmbH, all rights reserved.
#
###############################################################################

# script to generate an icon index file
#  1) store and name your icon files as described in sl_icon_create.html
#  2) change directory to {catalogdir}/slcatalog/icon
#  3) call script with
#      makeicon {classcode}
#
# result is written to {classcode}.IDX
# 
# filename = classcode(DOT)number
#                with number 001:    used for purpose PART
#                with number 002,003 used for purpose VIEW
#                with number 004,nnn used for purpose SML

if [ "${1}" != "" ]
then
  cd PART 
  for file in ${1}.001 ; do echo PART@${1}@PART/${file}@0>/tmp/_temp_.IDX ; done
  cd ..

  cd SML
  for file in ${1}.0?? ; do echo SML@${1}@SML/${file}@0>>/tmp/_temp_.IDX ; done
  cd ..

  cd VIEW
  for file in ${1}.002 ; do echo VIEW@${1}@VIEW/${file}@4@ans@2@anv@1@ebz@1@dsg@S>>/tmp/_temp_.IDX ; done
  for file in ${1}.003 ; do echo VIEW@${1}@VIEW/${file}@4@ans@4@anv@1@ebz@1@dsg@S>>/tmp/_temp_.IDX ; done
  cd ..

  cat /tmp/_temp_.IDX |sort >${1}.IDX
  rm  /tmp/_temp_.IDX
  echo ""
  ls  -oaL ${1}.IDX
else
  echo ======================================
  echo . 
  echo  call this script with ${0} classcode
  echo .
  echo  where classcode is e.g.  D00076-1
  echo .
fi
for NT systems, save as makeicon.bat
@echo off
rem ###############################################################################
rem
rem               Parametric Technology GmbH Confidential
rem
rem Description:  script to generate an icon index file
rem Author:       Wolfgang Traetner
rem Created:      Wed Sep 13 07:27:06 2000
rem Modified:     
rem Language:     DOS Batch
rem Package:      docu
rem
rem (C) Copyright 2000 Parametric Technology GmbH, all rights reserved.
rem
rem##############################################################################

rem script to generate an icon index file
rem  1) store and name your icon files as described in sl_icon_create.html
rem  2) change directory to {catalogdir}/slcatalog/icon
rem  3) call script with
rem      makeicon {classcode}
rem
rem result is written to {classcode}.IDX
rem 
rem filename = classcode(DOT)number
rem                with number 001:    used for purpose PART
rem                with number 002,003 used for purpose VIEW
rem                with number 004,nnn used for purpose SML

if "%1"=="" goto error
 
cd PART 
for %%A in (%1.001) do echo PART@%1@PART/%%A@0>..\_temp_.IDX
cd ..

cd SML
for %%A in (%1.0??) do echo SML@%1@SML/%%A@0>>..\_temp_.IDX
cd ..

cd VIEW
for %%A in (%1.002) do echo VIEW@%1@VIEW/%%A@4@ans@2@anv@1@ebz@1@dsg@S>>..\_temp_.IDX
for %%A in (%1.003) do echo VIEW@%1@VIEW/%%A@4@ans@4@anv@1@ebz@1@dsg@S>>..\_temp_.IDX
cd ..

type _temp_.IDX |sort >%1.IDX
del  _temp_.IDX
dir %1.IDX
goto end

:error
echo ======================================
echo . 
echo  call this script with %0 classcode
echo .
echo  where classcode is e.g.  D00076-1
echo .

:end
  

These tools have the status of a goodie (see <install-dir>/documentation/goodies/Readme.html)


[Books]