2.2.1.9. VB scripts

[Note]Note

Appropriate licenses are required to edit VB scripts. Otherwise license error messages will appear. VB scripts must be backed up for updates.

List of possible parameters and functions:

PREFIXLIST, PREFIXLISTREV, NAME, SHORTNAME, COMPANY, CATALOG, PROJECTNAME, CATALOGFOLDERNAME, GLOBVAR, MATERIAL, CLASSPROP, SEQ, XVARSET, VERSION, MIDENT, GENSHORTNAME, GENNAME, ENV, EVAL, MD5, ATTR, DATE, TIME, USER, RANDOM, SELLOD, CONFIG

If a called command is not available, code tracking can be used to find out which command this unknown command is, because it is then added to the log with the entry evalCommand:

A bit earlier, we see the check whether a dynamic value has been passed. All parameters and functions in the select case construction are listed there:

Example: Add your own function

Example "Add watermark":

Basic:

In addition, it should also be read dynamically from the first line of a text file that is located in a path that is centrally accessible to everyone, for example:

In the file current.txt the text stands for the current watermark: CADENAS GmbH Watermark.

After it it should now also be possible to use it within the Configure it. It is most skillful when it is added to the CadDocumentAttributes becomes. So every export has this stamp. Of course, it would also be possible to insert it directly into the cfg file, but this is not part of this example.

The following illustration shows how the new function can be accessed:

After restarting the module in CAD and PARTdataManager, the modified VB file is now loaded and is ready for use and functional. The part properties in CAD show the successful export. The WATERMARK entry has the value from the specified text file:

When will the changes take effect?

Immediately - directly with the next export without restarting the program.

How can I test VB scripts?

For example in PARTdataManager under the tab Extras > Start VBS/VBB Script.... [Start VBS/VBB script...]