Editing the ProFab V3.7 Tool Library
Copy the tool library file
(MCH00xxx.TLB in the API folder) to another folder, just in case something goes bad.
Start ACCESS and open the Tool
Library file.
There are four tables, Header,
LoopEntity, Shape, and ToolDescription.
Open the LoopEntity, Shape, and
ToolDescription tables.
Starting with the ToolDescription
table, find the tool number you want to
modify in the first column labeled ‘Tool ID’.
Scroll across to find the column
titled ShapeID. This provides the reference into the Shape table for
each tool. Remember this number.
Open the Shape table and in the
first column, find the ShapeID. This is the row you need.
The second column, ShapeType for a
Special tool shape is “0”.
Scroll across to find the column
LoopEntityID. This provides the reference into the LoopEntity table for
special tools. Remember this number.
Open the LoopEntity table and in the
first column find the LoopEntityID for the first entity of the shape.
The second column, ‘Type’ indicates
whether it is a Line or Arc entity. A “1” for a line and a “2” for an
arc. If there is a minus sign (-) it means the arc is traveled clockwise
instead of counterclockwise. On a line, it means the end points are
switched. This is used to help ProFab draw around the shape in a
continuous motion.
You will find columns Val1, Val2,
Val3, Val4, and Val5. These are the data for the lines and arcs.
For a Line, only the first four are
used. These are X, Y, X, Y for the two end points of the line.
For an Arc, it is X, Y, Radius,
Start angle, Sweep Angle. Note the angle values are in Radians, not
degrees.
One more column of importance is the
NextEntityID. This tells you which entity is next in the loop. A
NextEntityID of “0” means it is the end of the loop.
So now the real work, You are most
likely missing every other entity of the tool shape. The existing
entities are in sequence in the table, but there are no gaps in the ID
number to allow you to insert the additional entities. So you will need
to add them to the end of the table.
You can measure the DXF geometry in
ProFab to get the X, Y and Radius values. To convert an angle to
Radians, multiple the degrees by 0.017444 (3.14/180).
The NextEntityID is the real trick.
After you add a entity, look back at the first entity in the loop. Take
the NextEntityID from this line and place it in the new line you
created. Place the EntityID of the new line into the NextEntityID of the
first entity of the loop.
After you have added the missing
entities, save the tables.
Open ProFab and see how you did.
Tips:
If you can, delete all of your
specials which nee repair. Then add one and fix it in Access. Then add
the next one and fix it in Access. This will keep you at one end of the
table and make it a little easier to see the data for tool’s entities.
You can export the tables to Excel
and do the work there. After you would import them back to Access. Excel
will allow you to insert a line between existing lines and if you are
doing the last tool of the library, the renumbering of the entities is
pretty easy. This makes it cleaner for both you and ProFab.