Swim Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 106

Teamcenter Integration for

SolidWorks® 12.0.0
Administration Guide

SIEMENS AND ITI PROVIDE THIS PROGRAM AS IS AND WITH ALL FAULTS. SIEMENS AND ITI
SPECIFICALLY DISCLAIM ANY IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A
PARTICULAR USE. SIEMENS AND ITI DO NOT WARRANT THAT THE OPERATION OF THE PROGRAM
WILL BE UNINTERRUPTED OR ERROR FREE.
Siemens and the Siemens logo are registered trademarks of Siemens AG. Teamcenter is a trademark or
registered trademark of Siemens PLM. This software and related documentation are proprietary to Siemens
PLM. ©2018 Siemens AG. All rights reserved.
SolidWorks® is a registered trademark of Dassault Systèmes SolidWorks® Corporation.
Copyright© 2018 International TechneGroup Incorporated, 5303 DuPont Circle, Milford, Ohio 45150, U.S.A. All
Rights Reserved.
This program contains software licensed from Siemens PLM. ©2018 Siemens PLM. All Rights Reserved

1-1
Contents

Contents .................................................................................................................................... ii

Chapter 1 Introduction .......................................................................................................... 1-1

Chapter 2 Product Configuration ......................................................................................... 2-1


Swim.properties .................................................................................................................................. 2-2
General preferences...................................................................................................................... 2-2
Open preferences ......................................................................................................................... 2-3
Save preferences .......................................................................................................................... 2-5
Create preferences ....................................................................................................................... 2-8
Active Workspace preferences ...................................................................................................... 2-8
Multi-CAD preferences .................................................................................................................. 2-8
swim.xml ............................................................................................................................................. 2-9
Attribute Mapping .......................................................................................................................... 2-9
Enabling property modification for existing item revisions ............................................................ 2-15
Configuring the Properties Panel for Save Operations ................................................................ 2-16
Configuring the Clone exclusion properties list ............................................................................ 2-20
User Defined Columns ................................................................................................................ 2-21
BOM Map .................................................................................................................................... 2-23
Auxiliary Files .............................................................................................................................. 2-26
Template Map ............................................................................................................................. 2-38
Dataset Map ................................................................................................................................ 2-39
swim.cfg ............................................................................................................................................ 2-41
Teamcenter Preferences ................................................................................................................... 2-42
Teamcenter DisplayName Constant.................................................................................................. 2-43
SolidWorks Options .......................................................................................................................... 2-44

Chapter 3 Utility Functions ................................................................................................... 3-1


Exporting SolidWorks® Models from Teamcenter with swimexport ..................................................... 3-1
Usage ........................................................................................................................................... 3-1
Description .................................................................................................................................... 3-2
Configurations ............................................................................................................................... 3-5
Toolbox Parts ................................................................................................................................ 3-5
Multiple Model Versions ................................................................................................................ 3-5
Instruction Files ............................................................................................................................. 3-5
Examples ...................................................................................................................................... 3-6
Importing SolidWorks® Models into Teamcenter with swimbulkimport ................................................ 3-7
Usage ........................................................................................................................................... 3-7

ii
Description .................................................................................................................................... 3-8
Bulk importing with a graphical user interface.............................................................................. 3-10
Bulk importing without a user interface ........................................................................................ 3-12
Toolbox Parts .............................................................................................................................. 3-13
Auxiliary Files .............................................................................................................................. 3-13
Limitations ................................................................................................................................... 3-16
Renaming SolidWorks® Models in Teamcenter ................................................................................ 3-18
Renaming SolidWorks® Models in Teamcenter with swimrename .............................................. 3-18
Renaming SolidWorks® Models in Teamcenter with SolidWorks→Rename ................................ 3-22

Chapter 4 Best Practice Recommendations ....................................................................... 4-1


Properties display in the Save As, Save All, Save Checkouts and Teamcenter New Dialogs .............. 4-1
Configurations ..................................................................................................................................... 4-3
Integration preferences related to configurations ........................................................................... 4-3
Solidworks® search paths ................................................................................................................... 4-3
SolidWorks® External References ...................................................................................................... 4-4
SolidWorks® Toolbox ......................................................................................................................... 4-4
SolidWorks® SpeedPak ...................................................................................................................... 4-5
SolidWorks® Virtual Components ....................................................................................................... 4-5
Multisite............................................................................................................................................... 4-5
Upgrading the Teamcenter database for multi-site ........................................................................ 4-5
Configuring Teamcenter Multi-Site to Export SolidWorks® Models ............................................... 4-7
Configuring Teamcenter Multi-Site for Transferring Ownership of SolidWorks® Models................ 4-7
Restricted access to data .................................................................................................................... 4-7
Opening a model with access restrictions...................................................................................... 4-8
Saving a model with access restrictions ...................................................................................... 4-10

Chapter 5 Troubleshooting .................................................................................................. 5-0


General guidelines .............................................................................................................................. 5-0
Logging ......................................................................................................................................... 5-0
Reporting problems ....................................................................................................................... 5-0
Integration launch ............................................................................................................................... 5-1
Runtime problems ............................................................................................................................... 5-4

Chapter 6 Customization points .......................................................................................... 6-1


Available User Exits ............................................................................................................................ 6-1
Integration generated XML .................................................................................................................. 6-2
Tags .............................................................................................................................................. 6-2
Sample XML generated by the Integration .................................................................................... 6-5
Response XML from custom code .................................................................................................... 6-13
Response Tags ........................................................................................................................... 6-13
Sample Response XML ............................................................................................................... 6-14

iii
Chapter 1 Introduction

When first installed, the Teamcenter® Integration for SolidWorks® is configured to satisfy most customers’
requirements. As users become more experienced with the product, the Teamcenter Administrator may want
to change certain settings to align with customer-specific requirements and processes. The Product
Configuration section of this document explains how to change the configuration, and why you may want to do
so.

The integration provides a set of utility programs to perform administrative-level functions on SolidWorks®
data. Those functions, and their usage, are described in the Utility Functions section of this document.

Finally, there is a small set of known issues that customers may encounter when working with the product.
These are covered in the Troubleshooting and Best Practices sections.

For technical support, please contact the Siemens Global Technical Access Center (GTAC). You can reach
GTAC via the World Wide Web at
http://www.plm.automation.siemens.com/en_us/support/gtac/
Or by telephone:
United States and Canada (800) 955-0000
In other countries, please see
http://support.industrysoftware.automation.siemens.com/services/global_number.pdf
For additional telephone numbers, or call (714) 952-5444.

1-1
Product Configuration

Chapter 2 Product Configuration

The integration’s CAD data management behavior is controlled by settings in five different locations:
• swim.properties
o This properties file may be controlled at the site level, and also made available to users or
groups of users for overriding of selected preferences. It is a text file containing a list of
keywords and values. Each keyword is documented within the file, and each has a default
value. Together they form a set of preferences which are read when SolidWorks® is
launched with the integration loaded. If the value for a particular keyword is not modified,
then the default value remains in effect. Some preferences in the swim.properties file are
best controlled at the site level, while others may be user-specific. The Teamcenter
Administrator at each site must decide which settings users are allowed to override.
• swim.xml
o A set of maps to control integration behavior at the site level. This file is not designed for
modification by anyone but the Teamcenter Administrator.

• swim.cfg
o This file exists only on the integration client workstations. It is not designed for site-level
administration, although customers may choose to install the integration in a network-
accessible location, and allow users to launch using desktop shortcuts. In that case, it may
effectively become a site-level configuration file. It is a text file with various settings to
control the interaction between the integration client, the operating system, and the
SolidWorks® session, as well as the configuration of certain elements of the Graphical User
Interface (GUI). Only a subset of the included properties is intended for modification by
customers.

• Teamcenter preferences

o There are several Teamcenter preferences that can have an effect on integration behavior.
These may be managed as user, group, role or site preferences, although by default most
are site preferences. The most commonly encountered scenarios are explained in this
guide, but the Teamcenter documentation provides the most complete description of these
preferences.

• SolidWorks® options

o Although the integration does not directly read or enforce settings from the SolidWorks®
Tools→Options dialog, such settings can indirectly influence the behavior of the
integration’s Save, Load and Update operations.

2-1
Product Configuration

By default, all three of the above files are located in the integration’s client installation directory (often
called SWIM_DIR in various documents). Both swim.properties and swim.xml may be read from other
locations as well. swim.cfg is only read from the client’s installation directory.

Swim.properties
The swim.properties file, located in the client installation directory, contains the preferences that can be
configured for a site or for an individual user. All of these preferences are optional.
This file is read as UTF-8. Use an editor that preserves the UTF-8 encoding to ensure support for any non-
ASCII characters that may be entered into the file.
Preference files may be named either swim.properties or .swimrc and may be placed in any of these locations:
• In the working directory where the Teamcenter Integration for SolidWorks® is started.
• In the user’s home directory.
• In the Teamcenter Integration for SolidWorks® installation directory.
When the Integration starts, it reads all swim.properties and .swimrc files in these locations. If several files
specify the same preference, the preferences from the working directory take precedence over those from the
user’s home directory, and preferences from the user’s home directory take precedence over those from the
installation directory. Preferences that are likely to have the same definition for all users should be specified in
the installation directory, while a user’s personal customizations may be specified in the home directory or
working directory preferences file.
It is recommended that the Teamcenter administrator maintain the installed swim.properties file as a read-only
master copy, and make all changes in a separate file, which is included in swim.properties using the
preferences.file setting, as in this example:
preferences.file = .\\swim_site.properties
This technique allows you to override each preference’s default value, while preserving the original unchanged
value for documentation. It also helps to quickly identify those preferences whose values have been changed
by the site.
Special syntax is available for “locking” settings so that users cannot override them, and for resolving values
through environment variables (especially useful for settings that point to directory or file locations). This syntax
is explained at the top of the swim.properties file, and so it is not repeated here.
Any of the published configuration settings may be overridden in the swim.properties file, but some are more
frequently changed than others. The following is a summary of the more commonly modified settings.

General preferences
table.columns.std With the default value, the integration displays the most commonly
needed properties of the CAD models. It is possible to display additional
or alternative properties, either by selecting from a predefined set
(documented in swim.properties) or by configuring display of custom
columns. The properties included in table.columns.std apply to all
integration dialogs, unless overridden by similar dialog-specific
preferences, such as table.columns.checkin and table.columns.update.

2-2
Product Configuration

log.file The integration automatically writes a log file to the session’s startup
directory, the location of which may be influenced by several factors
including the configuration of desktop shortcuts. Assuming that all users
have write access to a consistent location on their client workstations, it is
recommended to set log.file to a consistent value for all users, such as
c:\\temp\\txdlog.txt.

log.suppress The default setting for this option is 3, which includes the most important
information needed for troubleshooting. In some cases it may be
necessary to increase the level of logging detail. This may be done by
setting log.suppress to any value greater than 10000.

summary.table.rows.std This preference controls the properties which are displayed in the
Summary panel on the integration dialog windows. The swim.properties
file documents a predefined list of keywords that may be used to add or
change the set of displayed properties. In addition, any Teamcenter
property (out of the box or custom) may be added to the set by first
configuring the attribute as a mapped column (see the section on Column
Mapping, later in this document) and then adding the column map’s
display_name value to summary.table.rows.std.
update.table.autorefresh.interval The Teamcenter task panel within the SolidWorks® session must be
refreshed periodically to display up-to-date status for local models. By
default this is done explicitly by the user, but can also be done
automatically by the integration. This preference enables automatic
refreshing, and controls how frequently it occurs. Administrators should
use the auto-refresh option conservatively and only after careful
evaluation, since configuring too small an interval can result in
excessively chatty traffic between clients and the server, and can impose
a heavy load on Teamcenter’s enterprise tier.
iman.enterprise Certain advanced PLM interoperability features are enabled when
iman.enterprise is set to true, provided the user has access to the
necessary license. This license is distributed with the product named
Teamcenter Integration for SolidWorks® Enterprise Edition. The
initial value of this preference is determined during installation of the
integration client, and it may be changed, post-installation, in the
swim.properties file.

Open preferences

filters.checkout.choices Filters are check boxes that appear on the integration’s Open dialog.
They give the SolidWorks® designer control over how much CAD data is
downloaded from Teamcenter to his client. A subset of the available

2-3
Product Configuration

filters is displayed by default. Filter options can be added or removed by


modifying this preference.

filters.checkout.default Once the available filters are configured, it is advisable to set them to the
appropriate default true or false values, so that the users do not have to
frequently change the filter options. Users can change and apply filter
options in the Open Dependencies dialog, if displayed, but each change
requires the integration to recalculate the dependency tree, and this can
take significant time for very large structures. Filter options that are
included in the filters.checkout.default preference are set to true by
default; filters not mentioned in this preference default to false.

checkout.exportdirectory If this preference is not set, then the initial value of Work Folder in the
Open dialog and in the Work Folder View of the Integration’s
Teamcenter panel will be controlled by SolidWorks®. If the user changes
his SolidWorks® directory, the next export from Teamcenter will be routed
to a different location on his client. The result is little or no consistency in
the location of managed Teamcenter files. For this reason, it is
recommended to set checkout.exportdirectory to a fixed location. The
syntax documented in the swim.properties file may be used to read an
environment variable as part of the path, for example:
checkout.exportdirectory=${USERPROFILE}\\sw. The SolidWorks®
option Referenced Documents must also be adjusted to match the
directory location specified by this preference, as documented under
SolidWorks Options.

checkout.exportdirectory.enable While this preference remains set to true (the default), the value of Work
Folder in the Open dialog can be changed using the Browse button. If
set to false, the value of Work Folder cannot be changed, and all files
will be fetched to the location specified by the
checkout.exportdirectory preference. Additionally, new models can
only be saved from the checkout.exportdirectory location.
Attempting to save a new model from other than the configured location
will result in this warning:

Figure 1 - Saving a model from outside of the Work Folder

checkout.updatefrombom This setting controls structure synchronization when a SolidWorks®


assembly is opened from Teamcenter. Structure synchronization is only

2-4
Product Configuration

available when iman.enterprise=true, and when the user has acquired


an enterprise-level license. Sites that do not expect or allow assembly
structure modification to occur outside of SolidWorks® should not set this
preference to true, as the additional functionality does carry a
performance cost.
iman.bomrevisionruledefault When this preference remains unset, the default revision rule that is
applied to the operation is determined by the user’s Default Revision Rule
setting, in the Rich Client’s Options | Product Structure dialog.
Customers may want to configure a different revision rule as the default
for SolidWorks® users, and this can be done by setting
iman.bomrevisionruledefault to the name of any revision rule defined
in Teamcenter. It is important to configure a default revision rule that is
appropriate for most users, most of the time, because this rule will be
used to configure the selected top-level model during Open.

iman.bomrevisionrule.allowed When this preference remains unset, all revision rules defined in
Teamcenter are available from the drop-down selection list in the Open
dialog. Site administrators may control the set of available revision rules
by assigning colon-separated values to this preference. Furthermore, the
ordering of available revision rules in the drop-down list will match the
ordering of the values assigned to the preference.

Save preferences
checkin.after This setting controls the default value of the Action on Save control on
the save dialog. Some customers may wish to change this default so that
users do not have to remember to do it themselves, during each save
operation.

checkin.owner.integration.ignore This preference controls whether models can be saved to existing


Teamcenter Item Revisions. Such existing revisions may be mastered by
another integration. Ownership of an Item Revision is determined by the
presence of an integration-specific dataset. For the SolidWorks®
integration those datasets are SW* (SWAsm, SWPrt, SWDrw …). The
default setting of false prevents saving models to existing Item
Revisions that do not already contain a SolidWorks® integration dataset.
A value of true allows saving models to any Item Revision. It is
recommended to maintain the default setting of false, unless there is a
good reason to change it.

eai.jtenabled When the SolidWorks® translator is installed, the integration can call the
translator to create JT files during save to Teamcenter, and then
automatically upload the resulting JT files into the Teamcenter Bill of
Materials. The translation is controlled by a check box on the save
dialog, labeled Save JT Files. Because client-side JT translation can
have a significant impact on save performance, Administrators may wish

2-5
Product Configuration

to disable this function by default, and this is done by retaining the OOTB
value of false.

iman.addonlynewtoselected By default, all new items are put into a Teamcenter folder. If the user
selects a folder in the save dialog, then the items are put into that folder.
If he does not explicitly select a folder (this is done by selecting the top-
level Teamcenter folder in the folder selection dialog, as shown below),

Figure 2 - Selecting the top-level Teamcenter folder

then the location of the newly-created items is controlled by the


WsoInsertNoSelectionsPref preference in Teamcenter. Setting the
iman.addonlynewtoselected preference to false tells the integration
that not only new items, but also existing items being saved as new
versions or new revisions, should be put into the destination folder. This
creates links in Teamcenter such that a given item may belong to multiple
folders. A typical use case for this is to collect all the components for a
large assembly structure into a single folder, so that Teamcenter users
can easily find them together.

checkin.ignoremissing Customers often have CAD assemblies that contain references to


obsolete dependencies, or to models that are not available to the
SolidWorks® session. When an assembly is saved to Teamcenter, the
integration will find and report these as missing references, and will ask
the user whether to continue with the save. Some customers have so
much data with this condition that they prefer not to see the warning
dialog on each save, and this can be configured by changing the
preference from prompt to always.

2-6
Product Configuration

sw.configurations.default With the default value of all, the integration will attempt to manage all
referenced and explicitly added configurations as distinct items and
datasets in Teamcenter. Customers who do not have naming conflicts in
their CAD data can accept the default setting, but many customers who
are migrating SolidWorks® data from other PDM systems, or from disk,
where naming conflicts exist and are tolerated, may wish to change this
setting to none. When set to none, the integration will ignore
configurations within documents, and will save only the documents to
items and datasets in Teamcenter. Configurations are still available
within the SolidWorks® session, because they are embedded within the
.sldasm and .sldprt CAD files managed by Teamcenter. The most
significant consequence of choosing to hide configurations in this way is
that they are not visible within Teamcenter and therefore cannot appear
as assembly components within the Teamcenter Bill of Materials. If
sw.configurations.default is changed to none, the related preference
sw.configurations.addbutton will be forced to false at runtime, so
that users cannot explicitly force configurations to be managed as items.

sw.configurations.hide Similar to sw.configurations.default, this setting will prevent


Teamcenter from saving configurations as items. However, it is not a
global setting but instead is a list of specific configuration names
(wildcards may be used) which should be hidden. Customers who use a
consistent naming convention for non-product or prototype configurations
should use this setting to hide those configurations from Teamcenter.
The default value is *speedpak to prevent SolidWorks® speedpak
configurations from being managed in Teamcenter. The *speedpak
value should be localized or converted to the correct string for the site.

sw.configurations.keep The opposite of sw.configurations.hide, this setting will permit


configurations to be saved only if their names match a specified pattern
(which may be a regular expression). Those not matching the pattern will
not be saved as items in Teamcenter.

sw.configurations.masters SolidWorks® itself creates a master configuration, named Default, for


each document, unless configured otherwise. This setting should contain
the names of all master configurations used by the site. For example, a
site running in the French locale may have configured SolidWorks® to
create master configurations as Défaut. Such a site should set
sw.configurations.masters = Défaut.

sw.configurations.master.document.same Instead of using a consistent name, or set of names, for master


configurations, some customers have named their master configuration
the same as the document which contains it. In such cases, the default
setting for this preference should be retained. If configurations named the
same as the document are not intended to represent the master
configuration, then this setting should be changed to false, and during

2-7
Product Configuration

save to Teamcenter the users will be required to rename either the


document or the same-named configuration.
checkin.require.unique.dataset For performance and reliability, it is recommended that no two
SolidWorks® datasets® of the same type (SWPrt, SWAsm, etc) share the
same name. Customers who assign item IDs from Teamcenter AND
configure the integration to automatically rename the CAD models will
never encounter this situation. For those customers who allow users to
control the CAD model names, this preference (when set to true) will
prevent duplicate datasets within the scope of a single Teamcenter site.

Create preferences
registernew.enable This preference controls whether the Teamcenter New dialog is
displayed when a new model is created in SolidWorks®. The default
value is prompt, but it may be changed to always or never. Regardless
of the setting, the user may cancel from the dialog, if displayed. Doing so
reverts to standalone SolidWorks® behavior, in which the new local
model remains unknown to Teamcenter until it is saved.

registernew.enable.manual.itemid This preference controls whether users are allowed to assign item IDs of
their own choosing while creating a new Teamcenter item from within
SolidWorks®. Changing this preference to false will force users to
assign item IDs from Teamcenter, typically to satisfy naming rule
requirements.

Active Workspace preferences


activeworkspace.enabled This preference controls whether the Active Workspace tab is displayed
in the swim panel within SolidWorks®. This should only be set to true if
Active Workspace is installed on the Teamcenter server.

Multi-CAD preferences
Users with access to enterprise licenses can incorporate designs from other Mechanical CAD systems into
their SolidWorks® designs, leveraging the design reuse capabilities of SolidWorks® itself. The following
preferences determine which file types are recognized as eligible for Multi-CAD use cases.
SW2_Foreign_Datasets This preference is a colon-separated list of 3D foreign datasets that the
SolidWorks® integration recognizes. Possible values are:
• ProAsm Creo® Parametric assembly
• ProPrt Creo® Parametric part
• AIAssembly AutoDesk Inventor® assembly
• AIPart AutoDesk Inventor® part
• SE Assembly SolidEdge® assembly
• SE Part SolidEdge® part
• DirectModel DirectModel (JT) part
Only include the dataset types that are useful in collaboration at your site.
The ordering of the list determines the order in which the integration

2-8
Product Configuration

searches for datasets. For example, if you prefer to reuse a Creo® part
dataset, and to revert to a DirectModel dataset if a Creo® part is not
available, then ensure that ProPrt appears before DirectModel in the
colon-separated list.

SW2_<dataset type>_nr_type These preferences establish the named reference values for each dataset
type listed in the SW2_Foreign_Datasets preference. There must be
one preference for each dataset type listed. For example:
• SW2_ProPrt_nr_type=PrtFile
• SW2_ProAsm_nr_type=AsmFile
• SW2_AIAssembly_nr_type=AIAssembly
• SW2_AIPart_nr_type=AIPart
• SW2_SE\u0020Assembly_nr_type=SE-assembly
• SW2_SE\u0020Part_nr_type=SE-part
• SW2_DirectModel_nr_type=JTPART
As shown in the SolidEdge® examples, spaces must be escaped with the \u0020 character string.
Note
When Creo® Parametric family table instances are configured for reuse within SolidWorks®, the Teamcenter
Integration for Creo® must be configured to save instance accelerator files to Teamcenter. This is required
because the SolidWorks® 3D Interconnect technology relies upon the accelerator (.xas and .xpr) files to open
the Creo® family table instances. See the Teamcenter Integration for Creo® documentation for more
information.
Note
Additional configuration steps involving the bom_map are required, in order to reuse non-native design data in
SolidWorks®

swim.xml
The swim.xml file, located in the installation directory, tells the Integration how to map SolidWorks® properties
to Teamcenter attributes, which BOMs to create when a model is saved to Teamcenter, whether auxiliary files
should be saved with models, which user-defined columns to display, and which Teamcenter dataset and
named reference types to use for SolidWorks® models. It is an XML file whose format is defined by swim.dtd,
also located in the installation directory. You may choose to manage swim.xml in its installed location, or you
can move and maintain it as a master read-only copy in a different, protected, location. If you move the file to
a different location, set the map.file user preference, in swim.properties, to define the path to it, and place a
copy of swim.dtd in the same directory as the new map file. The swim.dtd file must not be modified.

Attribute Mapping
When a model is exported from Teamcenter and opened in SolidWorks®, attributes assigned to the item, item
revision, dataset, or forms may be copied to properties in the SolidWorks® model. When a model is saved
from SolidWorks® to Teamcenter, its property values may be copied back to these objects. The attribute map
specifies which attributes should be copied for a particular type of SolidWorks® model. Some attributes appear
in the properties panel of the Save dialog and can be modified. These attributes have Create and/or SaveAs
operation descriptors in Teamcenter. Additional attributes can be added to the properties panel by modifying

2-9
Product Configuration

operation descriptors. Learn more by reviewing Properties display in Save Dialog and Teamcenter New
Dialog, elsewhere in this document.
Attribute mapping behavior is controlled by the attribute map in the swim.xml file. Each attribute definition
specifies the name of a property in the SolidWorks® model (this is the attribute’s CAD name), the name of the
corresponding attribute in Teamcenter (its PDM name) and additional information describing its default value,
what to do if the attribute does not exist, and so on. The attribute’s CAD name and PDM name must be
specified, and they must be the first and second tags, respectively, in an attribute definition. The other
elements of an attribute definition are optional and may appear in any order.
For example, here is an attribute map for SolidWorks® assembly and part models:
<attribute_map cad_type="sldasm:sldprt">
<attribute>
<cad_name value="PartNumber"/>
<pdm_name value="item_id"/>
<missing_attribute_action value="create"/>
<direction value="pdmtocad"/>
</attribute>
<attribute>
<cad_name value="Weight"/>
<pdm_name value="ItemRevision Master.wgt"/>
<default type="Double">1.0</default>
<direction value="cadtopdm"/>
<truncate value=”false”>
</attribute>
</attribute_map>
The cad_type defines the type of SolidWorks® model to which this map applies. The allowed cad_type values
are the six-letter extensions that SolidWorks® uses to identify its model files, in this case “sldasm” for
assemblies and “sldprt” for part models. If more than one type is specified, use a colon to separate the type
names. Additional cad_type values of “slddrw” for drawings and “sldtbx” for toolbox parts may be used.
The example above specifies only two attributes to be mapped between Teamcenter and SolidWorks®. One
is the part number, which the map says is in a property named PartNumber in SolidWorks® assembly and part
models, and is the item ID in Teamcenter items. The other is the weight of the assembly or part, which is in a
SolidWorks® property named Weight and in an attribute named wgt in the item revision master form. The part
number is copied only from Teamcenter to SolidWorks® (the direction is pdmtocad), while the weight is copied
only from SolidWorks® to Teamcenter (the direction is cadtopdm). A property for the part number will be
created if it does not exist in the SolidWorks® model. If the weight does not exist in the SolidWorks® model, a
default value of 1.0 will be stored in the form attribute (this is specified by the default tag).
Each attribute tag is a single mapping of SolidWorks® property and Teamcenter attribute. A property
can be mapped to multiple attributes by adding additional attribute tags for each mapping. Similarly,
an attribute can be mapped to multiple properties by adding additional attribute tags. The integration
does not validate multiple mappings; each mapping is performed without respect to any rules. It is
the site administrator’s responsibility to establish a useful set of mappings.
The tags that can be used in an attribute definition are described below. Some of these descriptions refer to
source and destination attributes. When opening a model, the source attributes are those in Teamcenter and
the destination attributes are the properties in SolidWorks®. When saving a model, the source attributes are
the properties in SolidWorks® and the destination attributes are those in Teamcenter.

2-10
Product Configuration

cad_name
<cad_name value="name"/>
The cad_name tag specifies the attribute’s name in the SolidWorks® model, which should be the name of a
custom property in the SolidWorks® document. The cad_name tag is required and it must be the first tag in an
attribute definition. It has no default.
The following attribute function may be used instead of a property name, but only when direction is
"cadtopdm".
is_configuration() The attribute value is true if the SolidWorks® model is a configuration. The value is
false if the model is a document.
pdm_name
<pdm_name value="keyword"|"class[:type].name"/>
The pdm_name tag specifies the attribute’s name in Teamcenter. This name can be a keyword for certain
special attributes, or it can be a more general expression that gives the attribute’s name and the class and type
of object where the attribute can be found.
When only a single keyword is given for the value of the pdm_name, it may be one of the following:
dataset_desc The attribute is the dataset description.
item_desc The attribute is the item description.
item_name The attribute is the item name.
item_id The attribute is the item ID.
item_revision_id The attribute is the item revision level.
item_revision_desc The attribute is the revision description.
item_type The attribute is the item type. Since an item’s type cannot change after the item has
been created, this is ignored when copying attribute values to an existing item.
To specify attributes other than the special ones listed above, use the notation class.name for the pdm_name
value, where class indicates where the attribute will be found, such as on an item, and name is the name of the
attribute. The classes of Teamcenter objects currently supported are:
Dataset The attribute is a dataset property.
Item The attribute is an item property.
Item Master The attribute is one of the form properties in the item master. Note that there is a
single space in this class name.
Item.Form The attribute is a property in a form attached to an item. The form must be based on
a POM class derived from the Form class. If more than one form is attached to an
item, the first one that matches the class and type (see below) is used. Forms that
are stored as files are not supported.
ItemRevision The attribute is an item revision property.
ItemRevision Master The attribute is one of the form properties in the item revision master. Note that
there is a single space in this class name.
ItemRevision.Form The attribute is a property in a form attached to an item revision. The form must be
based on a POM class derived from the Form class. If more than one form is

2-11
Product Configuration

attached to an item revision, the first one that matches the class and type (see
below) is used. Forms that are stored as files are not supported.
For example, to specify the project_id attribute in the item revision master form, the name would be
<pdm_name value="ItemRevision Master.project_id"/>
An optional type can be specified using the notation class:type.name. An attribute object_desc that will be
used only for items of type Part would be named
<pdm_name value="Item:Part.object_desc"/>
Types may also be included in the compound notation used to specify a general form attribute. For example,
suppose items of type Part can have a form of type PartData. An attribute “data1” in a PartData form would be
named
<pdm_name value="Item:Part.Form:PartData.data1"/>
When using the class.name or class:type.name notation, name must be the attribute’s real property name,
not its display name.
Note
When a keyword or class.name specification exists for the attribute you want to map, and when the attribute
mapping applies to all Teamcenter Item types, then you may use the abbreviated syntax. If you want the
attribute mapping to apply to only one, or a subset, of the available Teamcenter Item types, then you must use
the fully qualified compound notation.
The pdm_name tag is required and it must be the second tag in an attribute definition, following the cad_name
tag. It has no default.
The Teamcenter attributes must be present in the swim_policy.xml or custom_policy.xml. If not present in
either policy file, then the site administrator should add the attribute to the custom_policy.xml (modification of
the swim_policy.xml file is not supported). In the custom_policy.xml, the attributes should be added under the
proper object type as shown below for an Item. The policy files are in the integration directory
(%SWIM_DIR%\policies)
<ObjectType name="Item">
<Property name="object_desc"/>
<Property name="Property2"/>
:
:
<Property name="Propertyn"/>
</ObjectType>

Note
Errors or performance degradation can occur if the attributes referenced as pdm_name are not included in the
policy file. Specifically, “assertion” failures may appear in the txdlog file if an attribute is missing from the policy
file.
A Teamcenter attribute may be mapped to SolidWorks® only if SolidWorks® supports an equivalent property
type. The following Teamcenter types should not be mapped to SolidWorks®: Boolean Array, Character
Array, Integer Array, Double Array, and Date Array. When saving SolidWorks® data to Teamcenter, such
attributes may be populated in the save dialog, provided the necessary create descriptors have been attached
in the BMIDE.
Teamcenter runtime properties are not supported. A property is defined as runtime via the BMIDE tool.

2-12
Product Configuration

default
<default type="Date"|"Double"|"Integer"|"String"|"Boolean">data</default>
The default tag specifies a default value to assign to the destination attribute when the source property is
missing. The value that is assigned to the destination attribute is data. Its type may be "Date", "Double",
"Integer", "String", or "Boolean" (note that double quotes are required around the type as shown, but should
not enclose data). Teamcenter types are defined in the template, and so type can only specify the
SolidWorks® type in the cadtopdm direction. When the type is "Date", the data must be in a valid date format.
When the type is "Boolean", data must be either true or false.
The default tag is optional. If the source property is missing and no default is defined, the attribute mapping is
skipped.
Note
Teamcenter dates and SolidWorks® dates are different. Teamcenter dates include time of day. SolidWorks®
dates do not include time. If the time is important, then the type for a date should be of type “String” to ensure
the date will include the time. If the time is not important the default type should be “Date”. If the date is to be
modified within SolidWorks®, it is best to use the “Date” type, as the integration may not be able to convert the
user value to a Teamcenter date format.
When Date is the default type, it is acceptable if the value of the date in the default tag is empty. Use an empty
default to avoid incorrect dates in Teamcenter.
missing_attribute_action
<missing_attribute_action value="create"|"ignore"/>
The missing_attribute_action tag specifies what to do when the mapping direction is “pdmtocad”, and the
destination CAD property is missing. Its value may be one of the following strings (these strings must be
enclosed in double quotes as shown).
"create" The destination property is created, if it does not exist. This is the default.
"ignore" The attribute mapping is skipped if the destination property does not exist.
The missing_attribute_action tag applies only to SolidWorks® properties. It is ignored when the
destination is a Teamcenter attribute. Thus it is only meaningful when the direction value is “pdmtocad” or
“both”.
direction
<direction value="both"|"cadtopdm"|"pdmtocad"/>
The direction tag indicates whether to copy the attribute only from Teamcenter to SolidWorks®, only from
SolidWorks® to Teamcenter, or in both directions. Its value may be one of the following strings (these strings
must be enclosed in double quotes as shown).
"both" The attribute is copied from Teamcenter to SolidWorks® when the model is opened,
and it is copied from SolidWorks® to Teamcenter when the model is saved. This is
the default. If the attribute appears in the Properties Panel of a Save dialog, any
modification made in the dialog will be written into the CAD file during save. If there
is no value in the model but a value existed in Teamcenter at the time of save and
that value appears in the properties panel, the Teamcenter value will be written into
the SolidWorks® model. The integration does not attempt to modify toolbox parts. If

2-13
Product Configuration

the sldtbx cad type is included in a mapping definition where direction = “both”, the
attributes will not be mapped from Teamcenter into the toolbox part.
"cadtopdm" The attribute is copied only from SolidWorks® to Teamcenter when the model is
saved.
"pdmtocad" The attribute is copied only from Teamcenter to SolidWorks® when the model is
opened. If the attribute appears in the Properties Panel of a Save dialog, any
modification made in the dialog will be written into the CAD file during save. If there
is no value in the model but a value existed in Teamcenter at the time of save and
that value appears in the properties panel, the Teamcenter value will be written into
the SolidWorks® model. The integration does not attempt to modify toolbox parts. If
a sldtbx cad_type is included in a mapping definition where direction = “pdmtocad”,
the attributes will not be mapped from Teamcenter into the toolbox part.

Note that two attribute definitions can be provided when different behavior is needed for each direction in which
the attribute is copied. One definition may specify the cadtopdm direction and the other definition may specify
the pdmtocad direction.
constraint
<constraint value="any"|"master"|"non_master"| “use_default_cfg” | "reserved"/>
The constraint tag restricts attribute copying to models with certain characteristics. Its value may be one of
the following strings (these strings must be enclosed in double quotes as shown).
"any" There is no restriction on copying the attribute. This is the default.
"master" The attribute should be copied only if the model “owns” its file, which in the case of
SolidWorks® means the model is a document. Use this constraint value to prevent
the attribute from being copied when the model is a SolidWorks® configuration.
"non_master" The attribute should be copied only if the model does not “own” its file. Use this
constraint value to copy the attribute when the model is a SolidWorks® configuration,
and to prevent the attribute from being copied for SolidWorks® documents. This
constraint does not apply to “default” configurations (where “default” is defined by the
sw.configurations.masters preference)
"use_default_cfg" The attribute should always be copied to or from the configuration-specific tab of the
model’s properties. Use this constraint when you want to ensure that all Teamcenter
attributes are accessed from the configuration-specific tab, whether the model is a
document or a configuration.
"reserved" The attribute should be copied only if the model is reserved by the user. Use this
constraint value to avoid modifying models that cannot be checked in. This
constraint applies only to the pdmtocad direction. It is ignored when attributes are
copied from SolidWorks® to Teamcenter.
The constraint tag may be used more than once. For example, to make sure an attribute is copied only to
models that are checked out for modification, and not copied to a SolidWorks® configuration, use two
constraint tags:
<constraint value="reserved"/>
<constraint value="master"/>

2-14
Product Configuration

truncate
<truncate value="true"|"false"/>
The truncate tag specifies whether an attribute should be truncated when mapping from CAD to PDM. Should
a SolidWorks® property be of greater length than the corresponding Teamcenter attribute, the attribute can be
truncated to the length of the Teamcenter attribute.
"true" Truncate the attribute prior to writing to Teamcenter.
"false" Default value. The attribute is not truncated before writing to Teamcenter. If
property is too long, an error will occur and the save will be stopped.
Note
If an error occurs, the user should correct the attribute length and re-save all data again, not just the model that
had the attribute problem, as some of the data may not have been saved.
Loading the Attribute Mappings into Teamcenter
The attribute mappings defined by the attribute_map tag in the swim.xml must also be defined in the
Teamcenter database. Follow the procedure Loading the Attribute Mappings defined in the Post-
Installation Configuration section of the Installation Guide. When performing those steps, use the
swim.xml file that contains the attribute mappings.

Enabling property modification for existing item revisions


By default and per Teamcenter design, users cannot assign or modify properties when saving new versions of
existing items. Teamcenter site administrators may selectively override this behavior by adding the
save_enabled_properties map to the swim.xml file. In the following example, several properties of both the
OOTB Item type and a custom type are made editable.

<save_enabled_properties>
<item_type name="Item">
<properties>
<pdm_property name="Item.object_desc"/>
<pdm_property name="Dataset.object_desc"/>
</properties>
</item_type>
<item_type name="ITI9_PropItem">
<properties>
<pdm_property name="Item.object_desc"/>
<pdm_property name="Dataset.object_desc"/>
<pdm_property name="Item.ITI9_PropItem.iti9_name"/>
<pdm_property name="ItemRevision:ITI9_PropItemRevision.Form:
ITI9_PropItemRevisionMaster.user_data_1"/>
</properties>
</item_type>
</save_enabled_properties>

save_enabled_properties tag

2-15
Product Configuration

<save_enabled_properties>
The save_enabled_properties tag contains one item_type entry per item type for which properties will be
editable in the Save and Bulk Import dialogs.

item_type tag
<item_type>
The item_type tag specifies a single item type whose properties will be editable in the Save dialogs.

properties tag
<properties>
The properties tag contains the properties to be enabled during save to Teamcenter.

pdm_property tag
<pdm_property name="keyword"|"class[:type].name"/>
The pdm_property tag specifies a Teamcenter property to be enabled during a Save operation. The name is
a general expression that gives the property’s name and the class and type of object where the property can
be found. The general expression syntax is the same as documented for the pdm_name tag in the Attribute
Mapping section of this document.
Note
Including a Teamcenter attribute in the save_enabled_properties map does not guarantee that the
integration will be able to assign or update the attribute’s value. Write permissions to Teamcenter attributes
are controlled by BMIDE template configuration. It is the responsibility of the Teamcenter site administrator to
ensure that configured Teamcenter attributes are accessible to integration users, as needed.

Configuring the Properties Panel for Save Operations


The properties panel in the Save dialogs is used to display and edit Teamcenter properties of SolidWorks®
models as they’re being saved. The default layout and ordering of the panel may not be appropriate for all
customers, and so a properties_panel_style map in the swim.xml file may be used to override both the
content and the sequencing of properties.
The properties panel is separated into two sections: Required Properties and Optional Properties.
Teamcenter configuration settings control which properties are required, and which are optional, as well as
which properties are visible on the Save dialogs.
The integration first reads the master properties definition from Teamcenter, then uses the
properties_panel_style map, if it exists, to alter the visibility and positioning of designated properties on the
Save dialogs.
Note:
The tags that control property visibility and ordering within the Save dialogs cannot be limited by item type.
They will be applied to all OOTB and custom item types. When deciding which properties to include, be sure
you have accounted for all item types that can be created by the SolidWorks® integration. The list of available
item types is controlled by the dataset_map in swim.xml, using the allowed_item_types tag.

2-16
Product Configuration

Required properties
Required properties appear in a flat list, undifferentiated by object type attachment. To specify the order of
required properties, use the order attribute within the required_properties tag. System-level properties
cannot be configured; these are:
• Item Type
• Item ID
• Item Revision ID
• Item Name
Any other custom or OOTB required property that appears in the Required section of the Save dialogs can be
configured. For example, here is the Save dialog for a custom item type. The properties_panel_style
map has not yet been added to the swim.xml file.

Figure 3 - Unconfigured Save dialog


The order in which OOTB and custom required properties appear (except for the four system-level properties),
is alphabetical, and cannot be controlled by configuration in Teamcenter. This customer can reorder the non-
system properties by adding the properties_panel_style map as follows:

<properties_panel_style>
<required_properties
order="Item.pa4Sourcing:Item.pa4ExportControlled:ItemRevision.pa4Active:
Item.ip_classification:Item.owning_project:Item.pa4Phase"/>
</properties_panel_style>

Figure 4 - Configured Save dialog

2-17
Product Configuration

Note:
If a Required property is omitted from the required_properties list, it will not appear on the dialog, even
though it is designated as Required by the Teamcenter operation descriptor. This may prevent users from
completing the Save or Create New operations from within SolidWorks®, unless other arrangements are
made to automatically assign a value to all required properties.
Optional properties
Unlike Required properties, Optional properties are organized by object type attachment, using a tabbed
layout. The visibility and ordering of the tabs, as well as the properties displayed on each tab, can be
controlled by the properties_panel_style map.
To modify the ordering of optional property tabs, use the order attribute within the optional_tabs tag. The
tag is a colon separated list of properties of the tabs. The valid tabs are: Item, Item Master, Item Revision,
Item Revision Master, and Dataset. The order of the list defines the order in which tabs are displayed. If a
tab is not included in the list, it will not appear on the dialog. For example, here is the Optional properties
panel for a custom item type. The optional_tabs tag has not yet been added to the
properties_panel_style map, and so the tabs appear in their default ordering.

Figure 5 - Unconfigured Optional properties tabs

Figure 6 - Unconfigured Optional properties panel


In this example, the custom item revision type has several custom properties that are important, and so the
customer wants the Item Revision tab to be the first displayed. He also wants to suppress the display of the
master form tabs. The optional_tabs tag shown below will accomplish this:
<properties_panel_style>
<required_properties
order="Item.pa4Sourcing:Item.pa4ExportControlled:ItemRevision.pa4Active:
Item.ip_classification:Item.owning_project:Item.pa4Phase"/>
<optional_tabs order="ItemRevision:Item:Dataset"/>
</properties_panel_style>

2-18
Product Configuration

Figure 7 - Configured Optional properties tabs


Finally, the ordering of OOTB and custom properties on each tab can be controlled by tab-specific tags within
the properties_panel_style map. As with Required properties, Optional properties appear by default in
alphabetical order. For example, here is the Item Revision tab without any configuration:

Figure 8 - Unconfigured Item Revision tab

The ordering of properties within each tab can be controlled by one of the following tags:
• item_properties
• item_revision_properties
• item_master_properties
• item_revision_master_properties
• dataset_properties
For example, the item revision tab’s properties can be reordered as follows:
<properties_panel_style>
<required_properties
order="Item.pa4Sourcing:Item.pa4ExportControlled:ItemRevision.pa4Active:
Item.ip_classification:Item.owning_project:Item.pa4Phase"/>
<optional_tabs order="ItemRevision:Item:Dataset"/>
<item_revision_properties
order="pa4ModeledBy:pa4EffectiveDate:pa4Reusable:current_id:has_module:
gov_classification"/>
</properties_panel_style>

2-19
Product Configuration

Note:
It is not necessary to qualify each property name with its owning object type, because the naming convention
applied to the tab-specific tags already provides the necessary information

Figure 9 - Configured Item Revision tab

If a property is omitted from the tab-specific tag, it will not appear, regardless of its Visible designation in the
Teamcenter operation descriptor definition.
Note:
Although the above examples are based on the Save dialog, the Teamcenter New and the Bulk Import utility
are also configured in the same way, by the properties_panel_style map.

Configuring the Clone exclusion properties list


The integration provides an assembly clone feature, in which models can be automatically excluded from the
clone operation based on one or more property values. The list of properties available in the Exclude model
if… panel on the Clone Options dialog is controlled by the clone_exclude_model_properties tag. This tag
specifies a list of pdm_property values that are to be listed in the exclusion list. Example properties are
already provided:

2-20
Product Configuration

Figure 10 the clone exclusion properties list


But most customers will want to extend or replace this example with their own set of properties
The syntax is the same as described in the Attribute Mapping section of this document. The following is a
sample clone_exclude_model_properties tag.

<clone_exclude_model_properties>
<pdm_property name="item_type"/>
<pdm_property name="item_name"/>
<pdm_property name="Dataset.object_type"/>
<pdm_property name="Dataset.object_name"/>
</clone_exclude_model_properties>

User Defined Columns


User defined columns are used to display attributes in the Integration’s dialogs which are not available as
keyword column tags in the swim.properties file preferences. Such columns may be associated with the
Teamcenter Item, Item Revision, Dataset or Form classes, or to properties of the SolidWorks® models. They
can be added to any table.columns.* preference in swim.properties. For example, the following setting causes
two user defined columns to be displayed for all dialogs that are not overridden by a separate preference:
table.columns.std = itemid:itemtype:itemrev:itemname: UserDefinedCol1:UserDefinedCol2:datasettype:cadname

where “UserDefinedCol1” and “UserDefinedCol2” are defined in the Column Map.


Column Map
Within a column_map definition can appear attribute definitions. Each attribute definition specifies the name of
a property in the SolidWorks® model (this is the attribute’s CAD name), or the name of an attribute in
Teamcenter (its PDM name). The attribute’s CAD name or PDM name, but not both, must be specified in a
column_map definition.

The column_map tells the integration about columns to be displayed in the dialogs. A column_map contains one
or more column tags. Each column definition specifies a tag associated with a preference value defined in the
swim.properties file. The display_name option tells the integration what to display in the column header. The
cad_name option specifies the name of a property in the SolidWorks® model (this is the attribute’s CAD name)
and the pdm_name option specifies the name of the corresponding attribute in Teamcenter (its PDM name).

2-21
Product Configuration

Here is an example of a column map:

<column_map>
<column tag="UserDefinedCol1">
<display_name value="Item Weight"/>
<cad_name value="Weight"/>
</column>
<column tag="UserDefinedCol2">
<display_name value="PDM Color"/>
<pdm_name value="ItemRevision Master.color"/>
</column>
</column_map>

The example above specifies two column maps. The first, named “UserDefinedCol1”, is a SolidWorks® weight
parameter named “Weight” with column heading of “Item Weight”. The other column, “UserDefinedCol2”, is a
Teamcenter attribute named color on the item revision master form with column heading of “PDM Color”. The
tags that can be used in a column definition are described below.

column tag
<column tag="name">

The column tag specifies the name to be used in the preference value in the swim.properties file. For
example, if the name is “UserDefinedCol1” then the name in swim.properties must match and must be unique
for the column map. Below is an example:

table.columns.std = itemid:itemtype:itemrev:itemname: UserDefinedCol1:datasettype:cadname

display_name
<display_name value="Column Description"/>

The display_name tag specifies the column description.

cad_name
<cad_name value="name"/>
The cad_name tag specifies the property’s name in the SolidWorks® model, or it may be the name of an
attribute function. The value appearing in the column will be the actual value from the SolidWorks® property,
not the display value from Teamcenter. If the cad_name tag is defined then the pdm_name tag cannot also be
defined. If it is the name of a property, it must obey the usual rules for SolidWorks® property names.

pdm_name

2-22
Product Configuration

<pdm_name value="keyword"|"class[:type].name"/>

The pdm_name tag specifies the attribute’s name in Teamcenter. The value appearing in the column will be the
display value from Teamcenter. If the pdm_name tag is defined then the cad_name tag cannot also be defined.
This name can be a keyword for certain special attributes, or it can be a more general expression that gives
the attribute’s name and the class and type of object where the attribute can be found. Both the keyword and
the general expression syntax are the same as documented for the pdm_name tag in the Attribute Mapping
section of this document.

BOM Map
The bom_map tag defines the view type for the BOMs that the Integration must create or update each time it
saves a SolidWorks® model in Teamcenter, as well as any BOM line attributes to be mapped to or from the
SolidWorks® Component Reference property. It has the following format.
<bom_map>
<bom_line parent_type="parent" child_type="child" view_types="type"/>
.
.
.
</bom_map>

BOM View Type


Each bom_line tag specifies the type of BOM view that must be created or updated whenever a SolidWorks®
model is saved. Both parent and child must be SolidWorks® model types defined by entity tags in the
type_map. The parent is the type of model for which the BOMs are being created. The child is the type of
model that will appear on the BOM line. The parent is a model that depends on the child. The type is the type
of BOM that should be given a BOM line for the child when the parent model is saved to Teamcenter.
For example, the following bom_map defines three BOM lines, one for assembly-to-assembly relationships, one
for assembly-to-part relationships, and one for assembly-to-toolbox part relationships. The first bom_line tag
states that, when an assembly model (parent_type) depends on another assembly model (child_type), the item
revision containing the parent model should be given a BOM of the view type. The second bom_line tag
makes a similar statement about the BOM to add to an assembly item revision that depends on a part model.
<bom_map>
<bom_line parent_type="sldasm" child_type="sldasm" view_types="view">
<bom_prop cadName="componentReference" pdmName="bl_sequence_no"
direction="pdmtocad"/>
</bom_line>
<bom_line parent_type="sldasm" child_type="sldprt" view_types="view">
<bom_prop cadName="componentReference" pdmName="bl_sequence_no"
direction="pdmtocad"/>
</bom_line>
<bom_line parent_type="sldasm" child_type="sldtbx" view_types="view">
<bom_prop cadName="componentReference" pdmName="bl_sequence_no"
direction="pdmtocad"/>
</bom_line>
</bom_map>

2-23
Product Configuration

Multi-CAD BOM mapping


Customers who have acquired the Teamcenter Integration for SolidWorks® Enterprise Edition license can
open non-native SolidWorks® models from Teamcenter, add them to their native SolidWorks® assemblies,
and save the native SolidWorks® to Teamcenter, retaining the non-native models as assembly components.
Additional entries to the bom_map are needed to identify the eligible relationships between non-native parts
and assemblies, and between non-native components and their native SolidWorks® assemblies. In this
example, the integration is configured to reuse 3D design data from Creo® Parametric, AutoDesk Inventor®,
SolidEdge®, and the DirectModel (JT) file format.
<bom_map>
<bom_line child_type="sldasm" parent_type="sldasm" view_types="view">
<!-- Uncomment the line below to set the componentReference -->
<!-- bom_prop cadName="componentReference" pdmName="bl_sequence_no" direction="pdmtocad"/ -->
</bom_line>
<bom_line child_type="sldtbx" parent_type="sldasm" view_types="view">
<!-- Uncomment the line below to set the componentReference -->
<!-- bom_prop cadName="componentReference" pdmName="bl_sequence_no" direction="pdmtocad"/ -->
</bom_line>
<bom_line child_type="sldprt" parent_type="sldasm" view_types="view">
<!-- Uncomment the line below to set the componentReference -->
<!-- bom_prop cadName="componentReference" pdmName="bl_sequence_no" direction="pdmtocad"/ -->
</bom_line>
<bom_line child_type="proasm" parent_type="sldasm" view_types="view"/>
<bom_line child_type="proprt" parent_type="sldasm" view_types="view"/>
<bom_line child_type="se assembly" parent_type="sldasm" view_types="view"/>
<bom_line child_type="se part" parent_type="sldasm" view_types="view"/>
<bom_line child_type="aiassembly" parent_type="sldasm" view_types="view"/>
<bom_line child_type="aipart" parent_type="sldasm" view_types="view"/>
<bom_line child_type="directmodel" parent_type="sldasm" view_types="view"/>
<bom_line child_type="proasm" parent_type="proasm" view_types="view"/>
<bom_line child_type="proprt" parent_type="proasm" view_types="view"/>
<bom_line child_type="se assembly" parent_type="se assembly" view_types="view"/>
<bom_line child_type="se part" parent_type="se assembly" view_types="view"/>
<bom_line child_type="aiassembly" parent_type="aiassembly" view_types="view"/>
<bom_line child_type="aipart" parent_type="aipart" view_types="view"/>
</bom_map>

The syntax is the same as is used for native SolidWorks® assembly relations, except that non-native
assemblies are not eligible for occurrence-level attribute mapping via the bom_prop tag.

Note:
DirectModel files may only be reused as parts, not as subassemblies.

BOM Properties
A bom_line tag may optionally enclose several bom_prop tags, each of which specifies a SolidWorks®
component property to be synchronized with an occurrence attribute on the BOM line. The bom_prop tag
contains a direction for the mapping. The Component Reference property is the only supported SolidWorks®
property. This property can be shown in drawing annotations, such as tables or balloon notes. Any
Teamcenter BOM line property can be supported. The bom_prop tag can be repeated to establish multiple
mappings. One-to-many mapping can be used in the cadtopdm direction, but not in the pdmtocad direction.
Every bom_prop tag has the following structure
<bom_prop cadName="ComponentReference" pdmName="bl_sequence_no"
direction="pdmtocad"/>

2-24
Product Configuration

cadName The name of the SolidWorks® property. componentReference is the only supported
value, and it is only supported for SolidWorks® 2010 and beyond.

pdmName The name (not display name) of the Teamcenter bomline attribute. For example
bl_sequence_no is the name of the attribute displayed as Find No. All bomline
attributes are supported.

direction Allowed values are both, pdmtocad, and cadtopdm. If both, then the property will be
set in Teamcenter during save and in SolidWorks® during open. If pdmtocad, then the
property will be set in SolidWorks® during open. If cadtopdm, then the property will be
set in Teamcenter during save.
When bom_prop tags are included in the swim.xml file, the synchronization occurs during the Open and
Update Attributes operations.
Note:
If using BOM packing in the Structure Editor, the packing will be affected by pdmtocad mapping of
bl_sequence_no. In some cases portions of a bom could become packed or unpacked unexpectedly.
When mapping in the cadtopdm direction, the BOM attributes must be writeable. If not writeable, the save
operation will fail, resulting in corrupted data in Teamcenter. At a minimum, the BVR will be missing. The
integration assumes access to all attributes, as verification of the attribute on every BVR would be a significant
performance impact.
String attributes being mapped in the cadtopdm direction will be truncated if the value in cad is greater than the
maximum length of the attribute.
Drawing annotations which reference the component reference property will not automatically update if Load
referenced documents is set to None. Load referenced documents is a SolidWorks® system option, which
can be found on the Tools | Options | System Options | External References dialog.
Mapping BOM attributes in the cadtopdm direction, has a significant impact on the performance of the Open
and Update Attributes operations because the integration saves the all modified models to disk to ensure the
properties are stored in the SolidWorks® file. If users save the modified models back into Teamcenter,
performance will improve for all users that are using the file.

If any BOMLine properties are configured as source or destination in the bom_prop tag of swim.xml, those
properties must be present in the swim_bomattr_policy.xml file. If not already present, the site
administrator should add the property under “ObjectType name=BOMLine”, as shown below. The policy files
are in the integration’s installed client directory (%SWIM_DIR%\policies), on each SolidWorks® workstation.
<ObjectType name="BOMLine">
<Property name="Property1"/>
<Property name="Property2"/>
:
:
<Property name="Property"/>
</ObjectType>

2-25
Product Configuration

Note:
Errors or performance degradation can occur if the BOMLine properties referenced as pdmName are not
included in the policy file. Specifically, “assertion failure” errors may appear in the txdlog file if an attribute is
missing from the policy file

Auxiliary Files
When a model is saved to Teamcenter, additional local files may be saved with it. These files may also be
fetched from Teamcenter when the model is fetched. These additional files are called auxiliary files.
Examples of auxiliary files are JT files for use with Teamcenter visualization, GIF image files, and files of NC
machining instructions. The auxiliary_file_map tag tells the Integration about auxiliary files to save or fetch with
SolidWorks® models.
An auxiliary_file_map tag contains one or more auxiliary_file tags. It may also contain jt_file tags,
which are described in a later section on JT Files. The general purpose auxiliary_file tag specifies a
pattern for the name of a file, the dataset type and named reference type where the file will be stored in
Teamcenter, and optional commands for the operating system to execute. It may also specify a checkbox to
display in the Save dialog for users to choose whether auxiliary files should be saved.
General Auxiliary Files
The auxiliary_file tag supports most kinds of auxiliary files. Each is associated with a particular type of
SolidWorks® model. When a model of that type is saved to Teamcenter, the Integration will also save any
local files that match a specified file name pattern. When the model is fetched from Teamcenter, these files
can also be fetched.
For example, here is an auxiliary file map containing a single auxiliary_file tag for JT files.1 The
“cad_type=sldprt” entry means this auxiliary file definition is associated only with part models:
<auxiliary_file_map>
<auxiliary_file cad_type="sldprt">
<pdm_location named_ref="JTPART" pdm_type="DirectModel"
relation_type="IMAN_Rendering"/>
<file_name pattern="{cad_name}.jt"/>
<os_command cmd="doit {cad_file}"/>
<cadtopdm_control label="Save JT Files"
user_preference_name="eai.jtenabled"
user_preference_default="true"/>
</auxiliary_file>
</auxiliary_file_map>
The pdm_location tag tells the Integration where to put the auxiliary file in Teamcenter. In the example
above, the file will be stored in a dataset of type “DirectModel” and the file’s named reference will be
“JTPART”. The dataset is assumed to have the same name as the SolidWorks® model’s dataset. If the
dataset does not exist, it will be created and attached to the model’s item revision with an “IMAN_Rendering”
relation.
The file_name tag tells the Integration how to find the auxiliary file in the local file system. In the example
above, the name of the auxiliary file is composed of the model’s lower-case name with a .jt extension. It is not
an error if an auxiliary file cannot be found.

1 The jt_file tag, described later, is an easier way to handle JT files.

2-26
Product Configuration

An optional operating system command can be specified with the os_command tag. In the example above, the
Integration will tell the operating system to execute a command named doit, which takes the path to the
model’s file as its sole argument. Commands are executed after SolidWorks® writes models to the local file
system, but before the models or auxiliary files are saved to Teamcenter.
Note:
If an error occurs while attempting to execute the command, the auxiliary file will not be checked in to
Teamcenter.
The cadtopdm_control tag defines an optional checkbox to display in the Save dialog’s Auxiliary Files box.
In this example, the checkbox label will be “Save JT Files”. This tag also defines a user preference named
eai.jtenabled that sets the default state of checkbox. In this case, the checkbox is on by default.
The tags that can be used in a general auxiliary_file definition are described in more detail below.

auxiliary_file
<auxiliary_file cad_type="type" [direction ="both"|"cadtopdm"|"pdmtocad"]>

optional elements

</auxiliary_file>

The auxiliary_file tag is the general purpose definition of an auxiliary file. The cad_type defines the type
of SolidWorks® model to which the auxiliary_file tag applies. The allowed values for type are the six-
letter extensions that SolidWorks® uses to identify its model files. For example, “cad_type=sldprt” means the
auxiliary file is associated only with part models.
More than one SolidWorks® model type may be given for cad_type. Use a colon to separate each six-letter
value from the next. For example, to indicate that an auxiliary_file tag applies to parts, assemblies, and
drawings, the entry should be “cad_type=sldprt:sldasm:slddrw”.
The direction attribute indicates whether to save the file to Teamcenter when the SolidWorks® model is saved,
fetch it from Teamcenter when the model is fetched, or both. Its value may be one of the following strings
(these strings must be enclosed in double quotes as shown).
"both" The auxiliary file is saved to Teamcenter when the SolidWorks® model is saved, and
it is fetched from Teamcenter when the model is fetched.
"cadtopdm" The auxiliary file is saved to Teamcenter when the SolidWorks® model is saved, but
is not fetched with the model. This is the default.
"pdmtocad" The auxiliary file is fetched from Teamcenter with the SolidWorks® model, but it is
not saved when the model is saved.
The optional elements that can be included in an auxiliary_file definition are described below.

cadtopdm_control
<cadtopdm_control label="label" [user_preference_name="name"]
[user_preference_default="true"|"false"]/>
The cadtopdm_control tag creates a checkbox in the Save dialog that allows the user to choose whether to
save the auxiliary files specified by the auxiliary_file definition. The text labeling the checkbox is label. If the
same label is used for several auxiliary_file definitions, a single checkbox can control all of them.

2-27
Product Configuration

The user_preference_name tag creates a user preference name that can be used in the swim.properties file
to set the initial state of the checkbox. When the user preference is not set, the checkbox is initially checked or
unchecked according to whether user_preference_default is true or false.
If an auxiliary_file definition has no cadtopdm_control tag, the auxiliary files are always saved.
The direction attribute on the auxiliary_file definition must be cadtopdm or
both for the cadtopdm_control tag to have any effect.

create_text_file
<create_text_file file_name="path" [separate_files="true"|"false"]
[header="path"] [body="path"] [footer="path"]
[phase="in_cad"|"in_directory"|"in_pdm"]/>
The create_text_file tag specifies one or more text files to create. By default, the file(s) will be created
after SolidWorks® has saved the models to the local file system, but before the models or auxiliary files are
checked-in to Teamcenter.
Note:
If an error occurs while attempting to write a text file, the file will not be checked-in to Teamcenter.
The file to be created is specified by the file_name tag, where path is the path to the file. The path may
include keywords described in the section on Substitution Keywords. If separate_files is true, a separate
text file will be created for each model saved to Teamcenter. If separate_files is false, a single file will be
created, which may contain information about all models saved to Teamcenter.
Each text file is composed from three templates: the header, the body, and the footer. The header and footer
appear once in the output file, at its beginning and end, respectively. The body appears between these two
sections. If a single file is being created for all models, the body is repeated for each model being saved to
Teamcenter. The body appears only once in the output file if a separate output file is created for each model.
Each template is optional, although at least one must be specified. The header attribute specifies the path to a
text file that will be used as the header template, the body attribute specifies the path to a text file that will be
used as the body template, and the footer attribute specifies the path to a text file that will be used as the footer
template. The paths to these files may include keywords from the Substitution Keywords section, and the text
within these files may also use these keywords. If separate_files is true, keywords that imply a particular
model, such as {cad_name} and {cad_type}, can be used in any template and in any file path. If
separate_files is false, keywords that imply a particular model can be used only in the body template and in
the path to the body template file. The header and footer, and the file_name path, can use only keywords
that do not refer to a specific model when separate_files is false.
The use of these keywords in the paths to the template files makes it possible to use separate body templates
for parts, assemblies, and drawings, or to use separate templates for SolidWorks® configurations and
documents. For example, suppose the C:\text_templates directory contains a header template file named
header.txt with the following contents:
“These models are being checked-in to Teamcenter…”
and two body template files named sldprt.txt and sldasm.txt, in which sldprt.txt contains:
“A part named {cad_name} is being checked-in to Teamcenter.”
and sldasm.txt contains:
“An assembly named {cad_name} is being checked-in to Teamcenter.”

2-28
Product Configuration

A create_text_file tag that uses these templates to create a single text file summarizing the parts and
assemblies selected for check-in to Teamcenter might look like this:
<create_text_file file_name="summary.txt"
header="C:\text_templates\header.txt"
body="C:\text_templates\{cad_type}.txt"/>
When an assembly named Coupling and two parts, Pin and Shaft, are saved to Teamcenter, the contents of
summary.txt would be:
These models are being checked-in to Teamcenter…
A part named Pin is being checked-in to Teamcenter.
A part named Shaft is being checked-in to Teamcenter.
An assembly named Coupling is being checked-in to Teamcenter.
The {cad_type} pattern in the path to the body template would have been replaced with sldprt or sldasm,
depending on the model type, and the {cad_name} pattern in the body templates would have been replaced by
the model name.
You can also specify a phase in which the text file(s) will be created. Refer to the os_command tag for more
details concerning the phase attribute. By default, text files are created during the in_directory phase.

ets_request
<ets_request translator="service" [provider="name"] [priority="0"|"1"|"2"|"3"]
[request_per_model="true"|"false"]>
<translator_option name="translator_option">value</translator_option>
</ets_request>
The ets_request tag submits translation requests to Teamcenter’s Dispatcher after all models have been
checked in to Teamcenter. The name of the translator that will handle the request, also known as the service,
is given by the required translator tag. The default provider is “SIEMENS”, but other providers can be
specified with the optional provider tag. The translation request can be given a priority of 1, 2 or 3,
corresponding to low, medium or high priority, using the priority attribute. If the priority is set to 0, no
translation request is submitted.
By default, the ets_request tag submits a separate translation request for each SolidWorks® model of the
specified type that is saved to Teamcenter. However, if the translator can handle more than one model at a
time, you can set the request_per_model attribute to “false”, which will cause one translation request to be
submitted containing all models that have been saved to Teamcenter. For example, if four parts are saved to
Teamcenter and an auxiliary_file definition with a cad_type of “sldprt” specifies an ets_request, four
separate translation requests will be submitted by default or if request_per_model is explicitly “true”. If
request_per_model is “false”, a single translation request will be submitted containing all four parts2.
If an auxiliary file definition uses the ets_request tag, the Dispatcher will create the auxiliary file and import it
into Teamcenter, so there is no need to specify a file or a PDM location for it. For example, an auxiliary file
definition that submits a request for translating drawings to DXF files might look like this:

2 The OOTB translators SWToJT and SWToDXF do not accept more than a single model per translation request;
therefore the request_per_model attribute only applies to alternative or custom translators.

2-29
Product Configuration

<auxiliary_file cad_type="slddrw">
<cadtopdm_control label="Save DXF Files (ETS)"/>
<ets_request translator="swtodxf"/>
</auxiliary_file>
In this example, the cadtopdm_control tag adds a checkbox to the Save dialog, giving the user control over
whether the DXF file will be created.
If the translator accepts additional options, these can be specified with one or more translator_option
sub-tags. Refer to the documentation for your translator to determine whether additional translator options are
supported, and to find out the names and allowed values of these options. The name entry specifies the name
of a translator option, and the string to be assigned to that option is given by value. When
request_per_model is “true”, value may include any of the keywords that are described later in the
Substitution Keywords section. When request_per_model is “false”, only substitution keywords that do not
refer to a specific model should be used. Substitution keywords in value are replaced when the request is
submitted to the Dispatcher, not when the translation occurs.
The ets_request tag always submits Dispatcher requests during the in_pdm phase. An auxiliary_file
tag should not have more than one action per phase, so do not use other in_pdm actions within the same
auxiliary_file tag as your ets_request tag. See the section on the os_command tag for more
information on phases.

file_name
<file_name pattern="pattern" [version="all"|"latest"]/>
The file_name tag identifies the auxiliary file by defining a pattern that matches the file’s name. The pattern
may give an absolute path to the file, or the path may be relative to the directory where the SolidWorks® model
file is saved. The * wildcard character is allowed in the simple file name part of the pattern, but wildcards are
not allowed in directory names. For example, "myfile.*" and "images/*.gif" are acceptable patterns, but
"image*/myfile.*" is not allowed because a wildcard is used in a directory name.
The pattern may also include certain keywords that the Integration will replace with data from the model.
Keywords can be used anywhere in a pattern, both in the file name part and the directory parts of a path. The
recognized keywords are described later in the section on Substitution Keywords.
The optional version attribute indicates whether all auxiliary files matching the pattern should be saved to
Teamcenter, or only the file with the latest modification time. The default is "all", which saves all auxiliary files
that match the pattern.
The file_name tag is optional. If it is not included in an auxiliary_file tag, the Integration will not attempt to
find and save an auxiliary file when it saves the corresponding SolidWorks® model, nor will it attempt to
execute any operating system commands specified by the os_command tag.

os_command
<os_command [cmd="command"] [pre_cmd="command"] [post_cmd="command"]
[phase="in_cad"|"in_directory"|"in_pdm"]
[ignore_status="true"|"false"]/>
The os_command tag specifies one, two, or three optional commands for the operating system to execute. By
default, these commands are executed after SolidWorks® has saved the models to the local file system, but
before the models or auxiliary files are checked-in to Teamcenter.

2-30
Product Configuration

Note:
If an error occurs while attempting to execute one of these commands, the auxiliary files affected by that
particular auxiliary_file tag will not be checked-in to Teamcenter.
The string in cmd="command" is an operating system command that is executed for each SolidWorks® model
saved to Teamcenter. The command string may include the same keywords allowed in the file_name
pattern, which are listed in the section on Substitution Keywords.
When file arguments to the os_command contain spaces, they should be quoted with the xml &quot entity.
For example, if the cad_file being processed by the following mapping might have spaces, then the cad_file
designation should be enclosed by "&quot" as shown:
<os_command cmd="c:\apps\swim\pdf.bat" &quot;{cad_file}&quot;" phase="in_directory"/>
The strings in pre_cmd="command" and post_cmd="command" are also operating system commands. The
pre_cmd string is executed once, before any cmd strings from any auxiliary_file tag are executed (“once”
means just once during a Save, Save As, Save Checkouts, or Save All command, regardless of the number of
models being saved). The post_cmd string is also executed only once, after all cmd strings from all
auxiliary_file tags have been executed. The pre_cmd and post_cmd strings may also include some of the
keywords described in the Substitution Keywords section, but not every keyword is meaningful in these
command strings. Since pre_cmd and post_cmd are not associated with one specific model, keywords that
refer to a model’s name, directory, item ID, or other model-specific data, are not applicable in these strings.
If you provide a pre_cmd, cmd, or post_cmd, the Integration requires the command to execute successfully
before it saves the auxiliary file to Teamcenter. If pre_cmd, cmd, or post_cmd fails, the auxiliary file matched
by the file_name pattern will not be saved. Also, if pre_cmd fails, neither cmd nor post_cmd will be executed.
If an operating system command exits with a non-zero status, the Integration usually assumes the command
has failed. However, if ignore_status="true" is specified, the Integration ignores exit status and assumes
commands always succeed when executed.
You can also specify the phase in which these commands will execute. When the Integration saves models
from SolidWorks® to Teamcenter, the models pass through three phases corresponding to the values that can
be assigned to the phase attribute:
in_cad The models are in the SolidWorks® session and have not yet been saved to the
local file system.
in_directory The models have been saved from SolidWorks® to the local file system, but neither
the models nor any auxiliary files have been checked in to Teamcenter.
in_pdm All models and auxiliary files have been checked in to Teamcenter.
By default, the commands specified by an os_command tag are executed during the in_directory phase,
which is usually the phase in which you would want to run any translators that read a SolidWorks® file to
create an auxiliary file. If you have any batch processes that must run after models have been checked in to
Teamcenter, you might want to use an os_command tag to launch them during the in_pdm phase. As a point
of interest, the ets_request tag submits translation requests during the in_pdm phase.
You can think of the os_command, create_text_file, and ets_request tags as actions within an
auxiliary_file definition. Each auxiliary_file definition may have one such action per phase, which
means that as many as three os_command tags can appear in an auxiliary_file definition if each one
specifies a different phase. Alternatively, an auxiliary_file definition could have one
create_text_file tag for the in_directory phase, an os_command tag for the in_pdm phase, and so
on.

2-31
Product Configuration

Every attribute in an os_command tag is optional.

preview_command
<preview_command [cmd="command"] [pre_cmd="command"] [post_cmd="command"]
[phase="in_cad"|"in_directory"|"in_pdm"]
[ignore_status="true"|"false"]/>
The preview_command tag specifies one, two, or three optional commands for SolidWorks® to execute. By
default, these commands are executed after SolidWorks® has saved the models to the local file system, but
before the models or auxiliary files are checked into Teamcenter. The preview_command tag is similar to the
os_command tag except the keyword “built-in file_name_tag” is added to invoke added functionality by the
Integration. You may notice that by default, the swim.xml file already has these tags:
<auxiliary_file_map>
<auxiliary_file cad_type="sldprt" direction="cadtopdm">
<!-- Uncomment the below if you want to give the user choice of
saving the preview files -->
<!-- cadtopdm_control label="Save PNG Files"/-->
<pdm_location named_ref="PNG" pdm_type="SWPrt"/>
<file_name pattern="{temp_dir}\{cad_name}p.PNG"/>
<preview_command cmd="built_in {temp_dir}\{cad_name}p.PNG"
ignore_status="true" phase="in_directory"/>
</auxiliary_file>
<auxiliary_file cad_type="sldasm" direction="cadtopdm">
<pdm_location named_ref="PNG" pdm_type="SWAsm"/>
<file_name pattern="{temp_dir}\{cad_name}a.PNG"/>
<preview_command cmd="built_in {temp_dir}\{cad_name}a.PNG"
ignore_status="true" phase="in_directory"/>
</auxiliary_file>
<auxiliary_file cad_type="slddrw" direction="cadtopdm">
<pdm_location named_ref="PNG" pdm_type="SWDrw"/>
<file_name pattern="{temp_dir}\{cad_name}d.PNG"/>
<preview_command cmd="built_in {temp_dir}\{cad_name}d.PNG"
ignore_status="true" phase="in_directory"/>
</auxiliary_file>
</auxiliary_file_map>

table_command
<table_command [table="table"] [file_name="filename"]/>

SolidWorks® supports several types of embedded tables, for both drawings and 3D models. The integration’s
table_command tag may be used to export any of the available tables to an Excel file, which is then saved to
Teamcenter along with the SolidWorks® design data. Supported table types are:
• BendTable
• BOMTable
• DesignTable
• GeneralTable

2-32
Product Configuration

• GeneralToleranceTable
• HoleTable
• PunchTable
• RevisionTable
• TitleBlockTable
• WeldmentCutListTable

Microsoft Excel® must be installed on the client from which the SolidWorks® data is being saved to
Teamcenter.
Note:
Tables cannot be exported for unresolved (suppressed or lightweight) models. For this reason, it is
recommended to configure the Dispatcher framework to generate and save table files, during JT and DXF
translation.
The following example includes all available table types:

<auxiliary_file cad_type="slddrw">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_BendTable.xlsx"/>
<table_command table="BendTable" file_name="{cad_name}_{cad_type}_BendTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="sldasm:slddrw:sldprt">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_BOMTable.xlsx"/>
<table_command table="BOMTable" file_name="{cad_name}_{cad_type}_BOMTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="sldasm:sldprt" direction="both">


<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_DesignTable.xlsx"/>
<table_command table="DesignTable"
file_name="{cad_name}_{cad_type}_DesignTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="sldasm:slddrw:sldprt">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_GeneralTable.xlsx"/>
<table_command table="GeneralTable"

2-33
Product Configuration

file_name="{cad_name}_{cad_type}_GeneralTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="sldasm:sldprt">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_GeneralToleranceTable.xlsx"/>
<table_command table="GeneralToleranceTable"
file_name="{cad_name}_{cad_type}_GeneralToleranceTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="slddrw">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_HoleTable.xlsx"/>
<table_command table="HoleTable" file_name="{cad_name}_{cad_type}_HoleTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="slddrw">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_PunchTable.xlsx"/>
<table_command table="PunchTable"
file_name="{cad_name}_{cad_type}_PunchTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="slddrw">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_RevisionTable.xlsx"/>
<table_command table="RevisionTable"
file_name="{cad_name}_{cad_type}_RevisionTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

<auxiliary_file cad_type="sldasm:sldprt">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_TitleBlockTable.xlsx"/>
<table_command table="TitleBlockTable"
file_name="{cad_name}_{cad_type}_TitleBlockTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

2-34
Product Configuration

<auxiliary_file cad_type="slddrw:sldasm:sldprt">
<pdm_location named_ref="excel" pdm_type="MSExcelX"
relation_type="IMAN_specification"/>
<file_name pattern="{cad_name}_{cad_type}_WeldmentCutListTable.xlsx"/>
<table_command table="WeldmentCutListTable"
file_name="{cad_name}_{cad_type}_WeldmentCutListTable.xlsx"/>
<cadtopdm_control label="Save tables" user_preference_name="checkin.xlsenabled"
user_preference_default="true"/>
</auxiliary_file>

Note:
Do not include mappings for tables that do not exist in your SolidWorks® data, as searching for non-existent
tables will unnecessarily degrade performance.

generate_command
<generate_command [cmd="command"] [pre_cmd="command"] [post_cmd="command"]
[phase="in_cad"|"in_directory"|"in_pdm"]
cad_type=”SolidWorks Save as type”
[ignore_status="true"|"false"]/>

With the generate_command, the integration will export and save any file type which can be exported from
a SolidWorks® session. To determine the list of eligible file types for a given CAD type, review the list of file
extensions displayed by the File | Save function in SolidWorks®.

The generate_command tag specifies one, two, or three optional commands for SolidWorks® to execute.
The export is performed before SolidWorks® has saved the models to the local file system, because
SolidWorks® makes minor modifications during export, and these modifications would otherwise appear as
misleading modification hints in the integration’s Save dialog. Below is an example of using these tags to
generate PDF files for SolidWorks® drawings:

<auxiliary_file_map>
<auxiliary_file cad_type="slddrw" direction="cadtopdm">
<pdm_location named_ref="PDF_Reference"
relation_type="IMAN_Rendering" pdm_type="PDF"/>
<file_name pattern="{temp_dir}\{cad_name}d.PDF"/>
<generate_command cmd="built_in {temp_dir}\{cad_name}d.PDF"
cad_type="PDF" ignore_status="true"/>
</auxiliary_file>
</auxiliary_file_map>

Note:
PDF files cannot be generated for individual part or assembly configurations. The PDF is generated for the
active configuration. PDF generation is intended for drawings.

2-35
Product Configuration

pdm_location
<pdm_location named_ref="ref" [pdm_type="dataset"] [relation_type="relation"]/>
The pdm_location tag specifies where an auxiliary file should be saved in Teamcenter. Auxiliary files
associated with a particular model are always saved in the same item revision as the model, but they can be
stored either in the model’s dataset, or in a dataset of their own.
The named_ref value must always be specified, where ref is the type of named reference to be used for the
auxiliary file. The pdm_type attribute is the type of dataset in which to store the auxiliary file. The dataset is
assumed to have the same name as the dataset holding the SolidWorks® model. If the pdm_type is not
specified, the auxiliary file is stored in the model’s dataset.
If a dataset must be created for the auxiliary file, it will be attached to the item revision using the type of relation
specified by relation_type. If not specified, the default relation type is "IMAN_Rendering".
The named_ref attribute is required in a pdm_location definition. The pdm_type and relation_type
attributes are optional.

jt_file
The jt_file tag is simpler than the auxiliary_file tag for configuring the Integration to save JT files.3 The jt_file
element shown below in the auxiliary_file_map makes this happen:
<auxiliary_file_map>
<jt_file action="translate" cad_type="sldprt:sldtbx"
eai_dir="D:\apps\translators\swjt"/>
</auxiliary_file_map>
This tells the Integration to save a JT file with each SolidWorks® part or Toolbox model saved to Teamcenter
(cad_type="sldprt:sldtbx"). For non-Toolbox parts, the JT file must have the same name as the part and must
be in the same directory as the model’s file. To apply this to both parts and assemblies, use "sldprt:sldasm"
for the cad_type value.
The file_name tag, described previously for general auxiliary files, may also be used within a jt_file element if
the JT file’s name will not have the same name as the part or will be located in a different directory.
Note:
The presence of a jt_file tag in the auxiliary_file_map makes the Save JT Files checkbox visible in the Save
dialog. When this checkbox is on, the jt_file tag is enabled and the Integration saves JT files as directed by the
action type. When this checkbox is off, the jt_file tag is disabled as if action is "none" and save is "false".
The default state of this checkbox can be set with the eai.jtenabled user preference. This option and others
are described in detail in the swim.properties file, found in the directory where the Teamcenter Integration for
SolidWorks® is installed.

3 Siemens’ SolidWorks®ToJT translator must be installed and licensed in order to generate JT files.

2-36
Product Configuration

Custom JT translator configuration


The integration invokes the SolidWorksToJT translator with a tessellation configuration file that is derived from
a template located in the integration’s swjt subdirectory. The name of the template file is swtojt.config.
The OOTB configuration settings in this template file are appropriate for most sites; however they may be
extended to meet customer-specific requirements. Available options are documented in the SolidWorksToJT
translator help documentation. Do not modify or delete any of the OOTB settings in the template file; they are
required for all JT translation, whether performed on the integration clients during save, or during Dispatcher-
driven JT translation

Substitution Keywords
Patterns of the form {keyword} can be used in the file_name pattern, in the os_command and in the
create_text_file tags. The Integration replaces these patterns with appropriate values. For example, if a
model is named widget, the pattern "{cad_name}.gif" will become "widget.gif" when widget is saved to
Teamcenter.
The modifier upper or lower may be appended to any keyword. Use a comma to separate the modifier from
the keyword, without spaces. The {keyword,upper} pattern will be replaced with a result that is all upper case.
The {keyword,lower} pattern converts the result to lower case. For example, the pattern
"{cad_name,upper}.gif" would produce "WIDGET.gif" when the model’s name is widget.
The escape modifier can also be appended to any keyword. This modifier causes every backslash in the result
to be replaced with two backslashes. For example, if the {cad_directory} pattern produces the result
"C:\work\latest", the pattern {cad_directory,escape} will produce "C:\\work\\latest".
The recognized keywords are:
{cad_dataset_uid} The UID for the model’s Teamcenter dataset, or an empty string if the dataset does
not exist at the time this pattern is replaced. When this pattern is used in an
os_command string, for example, the dataset might not exist during the in_cad and
in_directory phases.
{cad_directory} The absolute path to the directory containing the model file4.
{cad_file} The absolute path to the model file.
{cad_name} The model’s name.
{cad_type} The SolidWorks® six-letter model type, such as sldasm or sldprt.
{document_cad_name} The name of the model’s SolidWorks® document. If the model is a document,
this is the same as {cad_name}.
{group} The user’s current Teamcenter group.
{item_id} The Teamcenter item ID for the model.
{item_name} The Teamcenter item name for the model.
{item_revision_id} The Teamcenter item revision ID for the model.

4This keyword can be used only where a single model is implied, such as in the file_name pattern or in the os_command
cmd string. It is not recognized in the os_command pre_cmd or post_cmd strings because these commands are not
executed for each model.

2-37
Product Configuration

{item_revision_uid} The UID for the model’s Teamcenter item revision, or an empty string if the item
revision does not exist at the time this pattern is replaced. When this pattern is used
in an os_command string, for example, the item revision might not exist during the
in_cad and in_directory phases.
{item_uid} The UID for the model’s Teamcenter item, or an empty string if the item does not
exist at the time this pattern is replaced. When this pattern is used in an
os_command string, for example, the item might not exist during the in_cad and
in_directory phases.
{named_ref} The named reference for the auxiliary file.
{pdm_type} The Teamcenter dataset type for the auxiliary file. For example, if the auxiliary file is
saved in the same dataset as a SolidWorks® assembly model, the dataset type is
SWAsm. For JT files, the dataset type is DirectModel.
{swim_dir} The absolute path to the directory where the Teamcenter Integration for
SolidWorks® is installed.
{user_id} The user’s Teamcenter user ID.
.

Template Map
The template_map tag specifies template models, also known as seed models or start models, that can be
copied when a new model must be created. A template will usually be needed when the Open command
attempts to fetch a model from Teamcenter and the model’s dataset is empty. When that happens, a template
model of the required type will be copied and placed in the destination directory, and the copy is given the
name that the missing model should have had.
Note:
The template_map is only used when opening seed parts from Teamcenter. It is not used by the SolidWorks®
File | New command.

A template_map contains zero or more template tags:


<template_map>
<template cad_type="type" location/>
.
.
.
</template_map>
Each template tag specifies a location where a template can be found, either on the local file system or in
Teamcenter. Each template tag also has a cad_type attribute that specifies the type of SolidWorks®
model to be created from the template. The allowed values for type are "sldasm", "slddrw", and "sldprt".
If the template tag specifies a location in Teamcenter, more than one SolidWorks® model type may be given
for cad_type. Use a colon to separate each three-letter value from the next. For example, to indicate that an
item in Teamcenter contains templates for parts, assemblies, and drawings, the attribute should be
cad_type="sldprt:sldasm:slddrw".
The cad_type attribute should specify only one type when the location is on the local file system.

2-38
Product Configuration

The models used as templates should not depend on other models. When a model specified in the
template_map is copied to create a new model, that model alone is copied. No other models are copied with
it.
Note that, when a SolidWorks® document is copied to create a new model, the document is copied in its
entirety. The resulting new document will have the same configurations, with the same names, as in the
original.
A SolidWorks® configuration cannot be used as a template.
Using Templates from a Directory
A template model that is located in a directory is specified by the path to its file:
<template cad_type="type" path="path"/>
The file must exist, and path cannot contain any wildcards, but path may include keywords described in the
Substitution Keywords section for general auxiliary files, if the keywords do not imply a specific model. For
example, a SolidWorks® part model could be included in the template_map as follows.
<template cad_type="sldprt" path="C:\SW\data\templates\Part.sldprt"/>
Using Templates from Teamcenter
A template model located in Teamcenter is specified by its item ID, revision ID and model name:
<template cad_type="type"
item_id="item" [item_revision_id="revision"] [model_name="name"]/>
The revision and model name are optional, and if not specified, all revisions and datasets in the item are
searched for templates of the appropriate type. Wildcards may also be used in item, revision and name, as if
conducting a simple search in the Open dialog. If more than one revision of a model is found for a given type,
the latest one is used. If several models with different names are found for a given type, one is arbitrarily
selected. For example, suppose an item Seeds is created in Teamcenter to hold the templates for parts and
assemblies. This item can be referenced using a single template tag:
<template cad_type="sldprt:sldasm" item_id="Seeds"/>
If Seeds has a part named mm_part and an assembly named mm_asm, the document for mm_part will be
used to create parts and the document for mm_asm will be used to create assemblies. If Seeds has two
revisions, the documents from the later revision will be used. However, if Seeds also has a part model named
in_part, either mm_part or in_part will be arbitrarily selected as the template to use when creating a new part.
In a situation such as this, it may be helpful to also specify the model_name attribute so only one of these
models will be selected:
<template cad_type="sldprt:sldasm" item_id="Seeds" model_name="mm_*"/>

Dataset Map
Each type of SolidWorks® CAD model maps to a unique dataset type and named reference in Teamcenter.
The type_map and dataset_map tags define these one-to-one mappings. The type_map is not intended
for customer modification and so it is not covered in this document.
A typical dataset map is shown below.
<dataset_map>
<dataset allowed_item_types="Item:Part:Document" allowed_workflows="Quick
Release:Design Review" named_ref="AsmFile" pdm_type="SWAsm"/>

2-39
Product Configuration

<dataset allowed_item_types="Part:Item:Document" allowed_workflows="Quick


Release:Design Review" named_ref="PrtFile" pdm_type="SWPrt"/>
<dataset allowed_item_types="Item:Part:Document" allowed_workflows="Quick
Release:Design Review" named_ref="DrwFile" pdm_type="SWDrw"/>
<dataset allowed_item_types="Item:Part:Document" allowed_workflows="Quick
Release:Design Review" named_ref="TbxFile" pdm_type="SW2Tbx"/>
</dataset_map>

For each mapping between a SolidWorks® CAD type and a Teamcenter dataset type, the allowable named
reference, item types, and workflows are defined by an entity tag. The pdm_type identifies the dataset type,
and named_ref identifies the named reference for the SolidWorks® model. These tags should not be
changed by customers.

Allowed Item Types


The mandatory allowed_item_types tag is a colon separated list that defines the list of item types to
appear in the drop-down list on the Teamcenter New and Save As dialogs. The first item type in the list is the
default item type for the specified CAD type6.
Note:
Customers must configure each dataset type’s “allowed_item_types” to include the same item type for CAD
types which may be saved together to the same item ID, such as a drawing and its 3D model. This allows a
dataset such as a SWDrw to be saved under the 3D model revision. Otherwise an error will occur.
Assigning a singular and different value to the “allowed_item_type” preference for each dataset type will
prevent more than one dataset type from being saved under the same item revision.

Submit to Workflow
The integration can be configured to submit Item Revisions to a workflow process by adding “workflow” to the
table.columns.checkin preference in swim.properties.
The optional allowed_workflows tag is a colon separated list that defines the list of Teamcenter workflows
to appear in the workflow column drop-down list on the Save dialog. The first workflow in the list is the default
for the specified CAD type.
Note:
Customers must configure the same default workflow for CAD types which can be saved together to the same
item ID, such as a drawing and its 3D model. Assigning different default workflows to such CAD types can
result in the same item revision being submitted to multiple workflows simultaneously, which is not the desired
result.
The integration determines if an object is checked in, checked out, or released by evaluating the status of the
dataset. Workflows that apply status to the objects should set the status on the Item Revision and the
SolidWorks® dataset. Failure to set the status on the dataset will enable the user to continue to work on the

6Note that the ordering of the allowed_item_types list in the dataset map replaces the single iman.itemtypedefault
swim.properties preference that was used in earlier releases, providing more configuration flexibility.

2-40
Product Configuration

object. Teamcenter does not provide an out-of-the-box workflow that will simultaneously release both the Item
Revision and the Dataset. See the Teamcenter documentation for more information on how to create and
configure workflows.

swim.cfg
Settings in this file control what is displayed in the Integration’s CAD-centric, or embedded, user interface.
This is the Teamcenter view which appears as a tab in SolidWorks’ Add-in panel. Customers may modify any
of the following:
sw.toolbox.dirs The integration’s installation program asks the user whether SolidWorks®
Toolbox should be configured, and if so, updates this preference with the
specified path(s) to the Toolbox directories. If new Toolbox directories
are added after the initial installation, their paths should also be added to
this preference. It is a simple list of directory paths, separated by the ‘;’
character.

sw.manager.columns.tree This setting controls the appearance and ordering of columns in Active
Model View of the Integration’s Teamcenter panel. This view shows the
hierarchical structure of the model which is in SolidWorks’ active window.

sw.manager.columns.workdir This setting controls the appearance and ordering of columns in Work
Folder View of the Integration’s Teamcenter panel. This view displays
the contents of the currently selected Integration cache directory.

sw.manager.popup.fields When the user positions his mouse over a model in either the Active
Model View or the Work Folder View, the Integration displays a pop-up
summary window with information about the model. This preference
controls the attributes & properties which are displayed within this
summary window, and the order in which they are displayed.

sw.debugPrints When a more detailed client_socket.log file is needed for troubleshooting,


set this preference to any value greater than 0.

sw.highlightSwimToFeat By default, the Integration performs auto-selection and highlighting only in


the SolidWorks® to Teamcenter direction. Cross-highlighting in the
reverse direction is disabled for performance reasons. Customers who
work with smaller assemblies may want to enable this capability in the
Teamcenter to SolidWorks® direction, and may do so by changing this
preference’s value from 0 to 1.

2-41
Product Configuration

Teamcenter Preferences
TC_Allow_Longer_ID_Names: If the Teamcenter preference TC_Allow_Longer_ID_Names is set to true,
Item Ids and Item Revision names up to 132 characters, and Dataset
names up to 125 characters, are allowed. The Dataset names are limited
to 125 characters because of the limit of named references to 132
characters including extensions (7 characters are used for the extension,
such as .sldprt).

WsoInsertNoSelectionsPref: This preference controls where newly-created items are placed in


Teamcenter, when the user has not explicitly selected a destination
folder. This occurs when the user selects the top-level Teamcenter folder
in the Save dialog. The default for this preference is ‘1’, which means
that new items will be added to the Newstuff folder. Other integer values
cause the item to be added to either the user’s Home folder, or no folder
at all.

TC_relation_required_on_export: When SolidWorks® data is transferred from one Teamcenter site to


another, the Integration’s CAD-specific relationship must be traversed to
find and include all dependencies which are not already part of the
assembly BOM. The Teamcenter preference must be extended to
include the following relations:
▪ SWIM_dependency
▪ SWIM_master_dependency
▪ SWIM_suppressed_dependency
▪ SW2_configuration

EPM_multiple_processes_targets: The integration can be configured to submit Item Revisions to a workflow


process by adding “workflow” to the table.columns.checkin preference in
swim.properties. The integration does not prevent users from submitting
objects to multiple workflows. Sites which want to prevent this should set
the Teamcenter preference EPM_multiple_process_targets to “OFF”.

PS_new_seqno_mode: This Teamcenter preference controls whether assembly Bills of Material


are “packed” or not. In a packed BOM, multiple occurrences of the same
component are collapsed to a single occurrence with a Quantity value. In
an unpacked BOM, each occurrence of the component is a separate
BOM line, with a null Quantity value. See the Teamcenter documentation
for valid values for this preference.

SW2_rac_rename_enable: By default, renaming of SolidWorks® models in the Teamcenter Rich


Client is disabled. This site preference may be changed from false to

2-42
Product Configuration

true, and optionally reconfigured to apply only to specific groups and/or


roles, to enable renaming of SolidWorks® data from the Rich Client.

Pro2_disable_deep_copy: The integration’s server code overrides any BMIDE deep copy rules that
are deployed, such that all CAD datasets are copied as objects, and
integration-specific relations are propagated, during a Revise or Baseline
operation. Some customers, such as those in transition from
SolidWorks® to NX, may wish to disable all integration overrides to
restore BMIDE control of deep copy behavior, and may do so by
changing this preference from false to true.

TC_show_open_in_sw_button: Enables the SolidWorks® icon in the Teamcenter Structure Manager


when value is set to true. Users can click on the icon to send the
structure to SolidWorks®.

ActiveWorkspaceHosting.Sw2.URL: The Integration’s server installation process adds this preference and
assigns a placeholder value of
http://<CHANGE_ME_HOST>:<CHANGE_ME_PORT>/awc. Customers who
deploy Active Workspace for SolidWorks® data management must
replace this value with the appropriate values for their site.

ActiveWorkspaceHosting.URL: Teamcenter itself creates this preference, when Active Workspace is


installed and configured. It is ignored by the SolidWorks® integration
when the ActiveWorkspaceHosting.Sw2.URL preference exists.
Customers with multiple integrations supporting Active Workspace may
prefer to use a single generic preference to define the Active Workspace
connection URL, and if so, this preference may be used in place of
ActiveWorkspaceHosting.Sw2.URL. In that case, the
ActiveWorkspaceHosting.Sw2.URL preference must be completely
removed from the database.

Teamcenter DisplayName Constant


The DisplayName constant on each item type is read by the integration and used in the Object column in the
integration dialogs. The constant defines the attributes on the item that are combined to uniquely identify items
of the given type. The default value for the constant is sufficient for the default item types. Item types with
MultiField keys are not uniquely identified by the default DisplayName constant. For item types with
MultiField keys, it may be useful to add the key properties to the DisplayName constant so users can
distinguish between different items in the Object column of Teamcenter and integration dialogs.

Any attributes (other than multifield key attributes) configured in the DisplayName constant must be present in
the swim_policy.xml or custom_policy.xml file in the integration installation directory
(%SWIM_DIR%/policies). Missing properties must be added to the custom_policy.xml file. Failure to add
such properties will result in assertion failures and degraded performance. In the custom_policy.xml file,
the properties should be added under ObjectType where the name is the Item Type, as shown below.

2-43
Product Configuration

<ObjectPropertyPolicy xmlns="http://teamcenter.com/Schemas/Soa/ObjectPropertyPolicy">
<ObjectType name="ITI9_VendorItem">
<Property name="Property1"/>
<Property name="Property2"/>
:
:
<Property name="Property"/>
</ObjectType>
</ObjectPropertyPolicy>

SolidWorks Options
External References: This is a standalone SolidWorks® option found under
Tools→Options→External References. Set this option to None to
prevent SolidWorks® from unnecessarily loading a large set of externally-
referenced SolidWorks® models into session.
Referenced Documents: This is a standalone SolidWorks® option found under
Tools→Options→File Locations. For consistent integration behavior, it
must be set to the directory location which serves as the integration’s file
cache directory, which in turn is controlled by the
checkout.exportdirectory preference in swim.properties.

Large Assembly Mode: Found under Tools→Options→Assemblies, this specifies the threshold
number of assembly components beyond which the assembly will be
opened in its lightweight representation. The integration provides its own
Open Mode selector on the Open dialog, so it is possible to set the
SolidWorks® option to a very high number, and still open large
assemblies as lightweight. If an assembly is not explicitly opened from
Teamcenter as lightweight, and if the number of its components exceeds
the threshold value specified by the SolidWorks® option, then the
SolidWorks® option will take effect.

Note:
By default, SolidWorks® will use Large Assembly Mode when the number of files belonging to the assembly
or drawing being opened exceeds 500. Models larger than this default threshold value can take a very long
time to open in standalone SolidWorks®, even when the Teamcenter integration is not involved. It is highly
recommended to retain the default setting, or to configure an appropriate setting, for this SolidWorks® option,
to maintain acceptable performance when working with larger assemblies. The Teamcenter integration has
been enhanced to support saving of lightweight models to Teamcenter, without requiring them to be first
resolved.

2-44
Utility Functions

Chapter 3 Utility Functions

In addition to using the interactive Integration in your SolidWorks® session, you can also use several
command line utilities to work with SolidWorks® models in Teamcenter. These utilities are found in the same
directory where the Teamcenter Integration for SolidWorks is installed. These are:
• The swimexport utility for exporting SolidWorks® models from Teamcenter.
• The swimbulkimport utility for saving SolidWorks® models to Teamcenter.
• The swimrename utility for renaming SolidWorks® models in Teamcenter.
If the Integration’s installation directory is in your path, you can run any of these utilities by opening a shell or
command window for your operating system, and typing the utility’s name with appropriate arguments on the
command line. Arguments are shown in detail in the following sections under Usage. Arguments enclosed in
square brackets [] are optional, a vertical bar | separates alternate values that can be used for an argument,
and text shown in italics is to be replaced by an appropriate value when you use the command. For example,
swimexport -u username -p password [-export true|false]
shows the swimexport utility’s –export argument is optional because it is enclosed in brackets, and that its
value can be one of the literal words true or false, while username and password should be replaced by your
Teamcenter user name and password.

Exporting SolidWorks® Models from Teamcenter with


swimexport
The swimexport utility exports SolidWorks® models from Teamcenter. Datasets may also be checked out, i.e.
reserved, when exporting models. Models that are checked out by swimexport may be checked back into
Teamcenter with the swimbulkimport utility.

Usage
swimexport [-login] [-u=username –p=password
[-g=group]]
[-help]
[-project=project_id]
[-export_dir=path] [-delete_files] [-skip_files]
[-change_id=id] [-comment=string]
[-export=true|false] [-export_related=true|false]
[-checkout=true|false] [-checkout_related=true|false]
[-config=rule]
[-no_filters] [-filter=name] [-levels=limit]

3-1
Utility Functions

[-item_id=id] [-item_revision_id=rev]
[-model_name=datasetname] [-model_type=type]
[-dry_run] [-output=instructionfile]
[-log=logfile]
[-incomplete_operation_fatal | -incomplete_operation_ok]
[-serverhost host]
[-servername server]
file1 file2 ...

Description
The swimexport utility will export a SolidWorks® model, and the models on which it depends, from Teamcenter
to a local directory. The model to export may be identified with the –item_id, –item_revision_id, –model_name
and –model_type options on the command line, or several models may be specified in instruction files, given
by arguments file1, file2, etc., following any command line options. Instruction files are text files that list
models to export, one model per line.
Some options affect only explicitly specified models identified on the command line or in instruction files. Other
options affect implicitly specified models that are not identified on the command line or in instruction files, but
which are also exported because explicitly specified models depend on them.
The default action is to export all explicitly specified models and the models on which they depend, but this can
be changed using the –export option for explicitly specified models and the –export_related option for implicitly
specified models. To reserve models, the –checkout option reserves explicitly specified models and –
checkout_related reserves implicitly specified models. Models that have been reserved may be checked back
into Teamcenter using the swimbulkimport utility.
The swimexport utility uses the same mapping file and user preferences used by the Teamcenter Integration
for SolidWorks®.
One significant difference between the swimexport utility and the Teamcenter Integration for SolidWorks® is
that swimexport does not copy attribute values from Teamcenter to properties in the SolidWorks® models.
The swimexport options are described below.
-change_id=id
Specifies a change ID to assign to all datasets that are checked out (optional).
-checkout=true | false
True specifies that explicitly specified models should be reserved (optional). The default
is false, which means that these models will not be reserved. Note that if –export is
false, this option can be used to reserve a dataset without exporting the model file in it.
This option does not affect implicitly specified models. To reserve implicitly specified
models, use the –checkout_related option.
-checkout_related=true | false
True specifies that implicitly specified models should be reserved (optional). The default
is false, which means that these models will not be reserved. Note that if –
export_related is false, this option can be used to reserve datasets without exporting the
model files in them.
-comment=string
Specifies a comment to assign to all datasets that are checked out (optional).

3-2
Utility Functions

-config=rule
Specifies the name of a configuration rule (optional). The default is to use the rule
specified by the iman.bomrevisionruledefault user preference or the default Teamcenter
rule.
-delete_files
Specifies that conflicting files already in the export directory should be deleted before
any models are exported (optional). Files that do not conflict with the models to be
exported are not affected. If neither -delete_files nor -skip_files is specified, the
program will abort if any conflicts are found. If both -delete_files and -skip_files
are given on the command line, the last one specified takes effect.
-dry_run The utility goes through most of the actions it would ordinarily execute, but it does not
export any files or reserve datasets (optional). When used in conjunction with the –
output option, an instruction file can be generated for use in a subsequent run of this
utility.
-export=true | false
True specifies that explicitly specified models should be exported, which is the default
(optional). False means that these models will not be exported. Note that –checkout
may be true even if –export is false. This option does not affect implicitly specified
models. To export implicitly specified models, use the –export_related option.
-export_dir=path
Specifies the path to the export directory (optional). The default is to export models to
the default working directory as specified during product installation. The default
working directory can be overridden by specifying the checkout.exportdirectory
preference in swim.properties.
-export_related=true | false
True specifies that implicitly specified models should be exported, which is the default
(optional). False means that these models will not be exported. Note that the –
checkout_related option may be true even when –export_related is false.
-filter=name
Specifies a filter to use when collecting implicitly specified models (optional). Each use
of this option adds another filter to any filters previously specified. Later filters can
override the actions of previous filters. The default filters are those specified by the
filters.checkout.default user preference, but note that the -no_filters option can erase
those prior filters. See the filters.checkout.choices user preference for the names of
filters that can be used with this option. User preferences are described in the
swim.properties file located in the directory where the Teamcenter Integration for
SolidWorks® is installed.
-g=groupname
Specifies the group name to use when connecting to Teamcenter (optional). Ignored
when -login is specified.
-help Prints usage information and exits.
-incomplete_operation_fatal
Causes the program to exit when an operation on a model cannot be completed due to
an error (optional). The default is -incomplete_operation_ok.

3-3
Utility Functions

-incomplete_operation_ok
Causes the program to continue when an operation on a model cannot be completed
due to an error (optional). This is the default.
-item_id=id
Specifies the Teamcenter item ID of a model to export (optional). This option may be
used only once on the command line, but wildcards are allowed.
-item_revision_id=rev
Specifies the Teamcenter revision of a model to export (optional). This option may be
used only once on the command line, but wildcards are allowed.
-levels=limit
Specifies the number of levels to include in the hierarchy of dependencies when
collecting implicitly specified models (optional). If not specified, or if limit is a negative
number, the number of implicitly specified models is unlimited. A positive number sets
the maximum number of levels of implicitly specified models that can be collected. This
option has the same purpose as the limit.levels user preference, described in the
swim.properties file located in the directory where the Teamcenter Integration for
SolidWorks® is installed, although swimexport ignores limit.levels. The limit can only be
set using this command line argument.
-log=logfile
Defines the name of the log file that will be created (optional). If not specified, the log file
will be swimexport.txt in the current directory. Logging cannot be disabled and warning
messages cannot be suppressed, but otherwise the logging preferences in
swim.properties have their usual effect.
-login Uses the Teamcenter login dialog. When this option is specified, the -u, -p, -g, and
-servername options are ignored. Use –login to avoid having to escape special
characters that may be included in username, password, group or role.
-servername name
The Teamcenter server name. If not specified, the default server is that of the first
server in the client_swim.properties file, found in the integration’s client installation
directory. –servername is ignored when –login is specified.
-model_name=datasetname
Specifies the name of a SolidWorks® model, which may be either the name of a
SolidWorks® document or the name of a SolidWorks® configuration. The model name
is the same as the dataset name.
-model_type=type
Specifies the dataset type or the six-letter SolidWorks® model type. For example,
models stored in the files widget.prt and gadget.sldprt both have type sldprt, and their
datasets are of type SWPrt, so type for a SolidWorks® part model may be either sldprt
or SWPrt.
-no_filters
Causes any previous list of filters to be erased, such that no filters will be used when
collecting implicitly specified models. However, a new list of filters will be created if this
option is followed by one or more -filter options.

3-4
Utility Functions

-output=instructionfile
Defines the name of an instruction file to be written (optional). This file lists each model
exported or reserved from Teamcenter.
-p password Specifies the password to use when connecting to Teamcenter. Ignored when -login is
specified.
-project=project_id
Specifies the project to use when connection to Teamcenter (optional).
-skip_files
Specifies that conflicting files already in the export directory should be preserved by
skipping export of the corresponding files from Teamcenter (optional). Files that do not
conflict with the models to be exported are not affected. The default is to not skip files.
If neither -delete_files nor -skip_files is specified, the program will abort if any
conflicts are found. If both -delete_files and -skip_files are given on the
command line, the last one specified takes effect.
-u=username Specifies the user name to use when connecting to Teamcenter. Ignored when -login is
specified.

Configurations
Every SolidWorks® model in Teamcenter is represented by a dataset, even models that are configurations.
However, in the case of a configuration, the dataset does not contain the model’s file. Instead, configurations
depend on their document, and it is in the dataset for the document that the SolidWorks® model file is found.
If you “export” a configuration, swimexport will actually export the model file from the document’s dataset. If
you reserve a configuration, swimexport will also reserve the document.

Toolbox Parts
The swimexport utility does not export files for toolbox parts stored as sw2Tbx datasets. An assembly
exported by swimexport must be opened with a SolidWorks® installation having access to the toolbox. For
more information on managing Toolbox parts, see the Best Practices section in this document.

Multiple Model Versions


Only one version of any given SolidWorks® model will be exported in one execution of the swimexport utility.
For example, if several revisions of a model are specified on the command line or in instruction files, only the
first one encountered will actually be exported.

Instruction Files
An instruction file is a text file that lists SolidWorks® models. Each line in the file should identify one model.
Blank lines and comments are also allowed. The comment character is #. Any text between the comment
character and the end of the line will be ignored.
A model is identified by several keyword=value pairs. A value containing spaces must be enclosed in double
quotes, and keyword is one of the following:

3-5
Utility Functions

checkout This is the same as the –checkout command line option, but it applies only to the model
specified on the line where this keyword appears. The value may be either true or false.
If this keyword is not specified, the value of the –checkout command line option applies.
export This is the same as the –export command line option, but it applies only to the model
specified on the line where this keyword appears. The value may be either true or false.
If this keyword is not specified, the value of the –export command line option applies.
item_id The value is the item ID.
item_revision_id The value is the revision.
model_name The value is the name of the SolidWorks® model, which may be either the name of a
SolidWorks® document or the name of a SolidWorks® configuration.. The model name
is the same as the dataset name.
model_type The value is the dataset type or the three-letter file extension that identifies the
SolidWorks® model type. For example, models stored in the files widget.prt and
gadget.sldprt both have type sldprt, and their datasets are of type SWPrt, so model type
for a SolidWorks® part model may be either sldprt or SWPrt
property The property keyword identifies a MultiField key property and value. The syntax is
property[class.name] = value. The property is used with Item ID or model name to
identify a unique model for export.
If a value contains the space, #, or = characters, then the value must be enclosed in double quotes. Double
quote characters within the value must use \ character to escape the double quote.
A simple instruction file is shown below.
# Sample swimexport instruction file
item_id=702283 item_revision_id=B model_name=Bolt_A model_type=sldprt
item_id=702284 item_revision_id=A export=false checkout=false
item_id=702285 item_revision_id=A
item_id=702286 item_revision_id=C property[item.iti9_Vendor]= "Vendor1"
The first line is a comment. The second line identifies a particular model, the SolidWorks® part Bolt_A in
revision B of item 702283. No checkout or export keyword is given on this line, so the command line options –
checkout and –export will be used to decide whether to export and/or reserve this model. By default,
swimexport will export the model without reserving it.
The third line specifies an item ID and revision, but the model name and type are not given. If revision A of
item 702284 has several SolidWorks® datasets, this line affects all of them. For example, if revision A
contains both a part and a drawing, neither will be exported or checked out because export and checkout are
both false on this line.
The fourth line also identifies a model using only its item ID and revision. Since no export or checkout keyword
is included on this line, the model will be exported or reserved according to the command line options –export
and –checkout.

Examples
The following example shows a simple use of this export utility.
swimexport –u=infodba –p=infodba –item_id=702283 –item_revision_id=B

3-6
Utility Functions

This command will export the SolidWorks® model(s) in revision B of item 702283, plus all models on which it
depends. The model files will be placed in the current working directory. None of these models will be
reserved. If the models in 702283 should be reserved, the command becomes:
swimexport –u=infodba –p=infodba –item_id=702283 –item_revision_id=B \
-checkout=true –comment="Changes per 4283"
This reserves only the model in revision B of 702283, but the models on which it depends are still exported. If
the SolidWorks® model in revision B should be reserved without being exported, and the models on which it
depends also should not be exported, the command would be:
swimexport –u=infodba –p=infodba –item_id=702283 –item_revision_id=B \
-checkout=true –export=false –export_related=false \
–comment="Changes per 4283"
If 702283 is a configuration, the command above will also reserve the document regardless of how –
export_related is set.
Suppose an instruction file named exports.txt specifies the models to export. In this case, the command would
be:
swimexport –u=infodba –p=infodba exports.txt
To find out what will really be exported or reserved prior to executing the command above, use the –dry_run
option and ask swimexport to generate an instruction file:
swimexport –u=infodba –p=infodba –dry_run –output=out.txt exports.txt

Importing SolidWorks® Models into Teamcenter with


swimbulkimport
The swimbulkimport utility saves SolidWorks® models into Teamcenter, directly from a disk location. This utility
may be executed interactively, with a graphical interface, or in batch mode, from a Windows command line.
The interactive user interface is a simplified version of the Save dialog, so users will find it intuitive. The
command line interface can read an instruction file and therefore can be used as a scripted tool for importing
data. The bulk import utility is intended to simplify the import of relatively small and self-contained sets of data.
Items, Item Revisions, and Datasets may be created, property values may be copied to attributes in
Teamcenter, and BOMs may be updated.

Usage
swimbulkimport [-u=username -p=password [-g=group]]
[-help][-project=project_id]
[-log=logfile]
[-folder=Teamcenter folder]
[-no_gui [-login][-servername=servername]
[-dry_run [-output=instructionfile]]
[-all_configurations][-overwrite][-revise][-ignore_data_errors]
folder | instructionfile]

3-7
Utility Functions

Description
When the –no_gui argument is specified, the utility is run without a user interface. The models are read and
loaded directly into Teamcenter without user interaction. The -login, -overwrite, -revise, -
all_configurations, and -output options only apply to when the –no_gui option is specified. With the
–no_gui option, a folder or instruction file must be specified. The argument folder is a directory containing
SolidWorks® models to import. When a folder is specified, all the models in the Windows directory are
imported. An instruction file is a text file in which each line is a path to a SolidWorks® model file (all files must
be in the same directory). When an instructionfile is specified, only the models listed in the instruction file are
imported. If a dependency is not specified in the instruction file, it is not imported. Instruction files are often
used with –no_gui to explicitly identify the file names and properties of models to be imported.
When the -no_gui option is not specified, the utility displays a graphical user interface. The interface is
similar to the Save dialog so it should be familiar to integration users. The integration will launch in graphical
mode if the user double clicks on the swimbulkimport.bat file in Windows explore, or does not specify any
options when starting the utility from a command line.
Models are imported in two steps. In the first step, Teamcenter objects (items, item revisions, and datasets)
are created as needed and the model files are imported into the datasets. In the second step, parameter
values are copied from SolidWorks® to attributes of the Teamcenter objects.
When importing a model into an existing dataset, you must either use the –overwrite option or check out the
dataset prior to running swimbulkimport. Models will not be imported into datasets that are reserved by
another user. Also, if you reserve a dataset using check out with export, the model can only be imported from
the export directory that was specified at the time you reserved the dataset, and the model will be deleted from
that directory after it is imported.
The other arguments for swimbulkimport are described below.
-all_configurations
Saves all configurations within a document as distinct items in Teamcenter. This option
overrides the sw.configurations.default user preference to save all
configurations except those matching the sw.configurations.masters and
sw.configurations.hide user preferences. User preferences are described in the
swim.properties file found in the Teamcenter Integration for SolidWorks® installation
directory. The –all_configurations option is only valid when combined with the -
no_gui and folder options. If an instruction file is used, each configuration to be
imported must be included in the instruction file.
-dry_run The utility goes through most of the actions it would ordinarily execute, but it does not
import any files or other data to Teamcenter. When used in conjunction with the –
output option, an instruction file can be generated for use in a subsequent non-
graphical invocation of the utility. The –dry_run option is valid only when combined
with the -no_gui and folder options.
-folder=folder
Specifies the name of a Teamcenter folder, belonging to the user, into which new items
will be placed.
-help Prints usage information and exits.
-ignore_data_errors

3-8
Utility Functions

If the utility encounters a data error it is recommended that the user correct the errors. If
it’s not possible to fix the errors, specify this option to ignore the errors and by-pass the
import of the problem models. The –ignore_data_errors option is valid only when
combined with the -no_gui and folder options.

-log=logfile The absolute path to the log file to be written. If not specified, logging will be written to
the swimbulkimport.txt file in the directory where the Teamcenter Integration for
SolidWorks® is installed. Logging cannot be disabled and warning messages cannot be
suppressed, but otherwise the logging preferences in swim.properties have their usual
effect.
-login Uses the Teamcenter login dialog. When this option is specified, the -u, -p, -g, and
-servername options are ignored. Use –login to avoid having to escape special
characters that may be included in username, password, group or role. This option is
valid only when -no_gui is specified.
-output=instructionfile
The absolute path to an instruction file to be written. This option is to be used in
conjunction with –dry_run to generate an instruction file template containing the
models that the integration would attempt to import into Teamcenter, if the -dry_run
option were not included on the command line. The –output option is valid only when
-no_gui is specified.
-servername name
The Teamcenter server name. If not specified, the default server is that of the first
server name found in the client_swim.properties file. This option is ignored when
–login is specified, and is valid only when -no_gui is specified.
-overwrite
Causes existing model files already in Teamcenter to be replaced by imported files. The
default is to skip models that already exist in the latest revision. The –overwrite option
is valid only when -no_gui is specified.
-p=password Specifies the password to use when connecting to Teamcenter. This option is ignored
when -login is specified.
-project=project_id
Specifies the project to use when connecting to Teamcenter.
-revise Causes a new revision to be created for each model imported into Teamcenter. If the
latest revision is a major revision, then the new revision will be the next major revision. If
the latest revision is a minor revision, then the new revision will be the next minor
revision. The default is to import into the latest revision, skipping any model if the latest
revision already contains a version of the model. The –revise option is valid only when
-no_gui is specified.
-u=username Specifies the user name to use when connecting to Teamcenter. This option is ignored
when -login is specified.

3-9
Utility Functions

Bulk importing with a graphical user interface


To start the bulk import utility with a graphical user interface, double click on swimbulkimport.bat in the
integration client’s installation directory.

When the Teamcenter Login dialog appears, enter user credentials and other information as needed.

Figure 11 - Login dialog for bulk importer

Next, the user must select the work folder containing all of the required SolidWorks® models. All models to be
imported must be in the selected folder. The only exception is toolbox parts. The toolbox files must be
available from the folders defined by the sw.toolbox.dirs preference in swim.cfg.

Figure 12 - Folder selection dialog for bulk importer

At this point, the Bulk Import dialog appears. The dialog is similar to the Save dialog in presentation and
function. It is possible to assign Item IDs and revisions, identify models that already exist in Teamcenter, and
assign required and optional property values. For more information on how to use the dialog, review the Save
dialog documentation in the User Guide.

3-10
Utility Functions

Figure 13 - Bulk import dialog

Selecting the Save button will import all models into Teamcenter.
Configuration
The bulk import utility works like the Save operation. The configuration settings for the Save dialog apply to
the bulk importer. Review related preferences in the swim.xml, swim.cfg, and swim.properties files.

The properties shown in the dialog are those specified by the BMIDE templates’ Create Operation Descriptor
for the selected Item Type.
Validation before Import
Selecting the Validate button provides the user with a list of errors and warnings. The errors must be fixed
prior to completing the import or else the import will be stopped. Warnings may also be addressed prior to
import, but this is not mandatory.

Instruction Files
Select Export to save an instruction file containing all the models shown in the dialog, and the current property
values for those models. The instruction file can be modified manually and used in a future invocation of the
bulk import utility. Select Import to apply an instruction file to the current set of models. For each model in the
dialog that matches a model in the instruction file, the properties from the instruction file are applied to the
matching model.
If a value contains the space, #, or = characters, then the value must be enclosed in double quotes. Double
quote characters within the value must use the \ character to escape the double quote.

3-11
Utility Functions

Bulk importing without a user interface

To run the bulk import without a user interface, specify the –no_gui option on the command line.

Item IDs, Names, Types, and Revisions


A model’s item ID, name, type, and revision can be specified in an instruction file or by mapping parameters
from the SolidWorks® model to these attributes in Teamcenter. See the section on Instruction Files below for
more information on how to do this in an instruction file, or refer to the section on Attribute Mapping for more
information on configuring attribute mapping. If the model’s item ID, name, type, or revision is not specified,
the following defaults apply:
• The default item ID is assumed to be the same as the model name. The model name is also used as
the default item name. For example, if a part file widget.sldprt is imported into Teamcenter, the item
ID and item name will both be widget.
• The default item type is determined by a combination of the model’s CAD type and the first item type to
appear in the allowed_item_types list in the dataset map within the swim.xml file. See the section
on the Dataset Map for more details.
• The default revision is the latest revision of an item unless the -revise option is specified.
When several SolidWorks® models have the same item ID, they will be imported into the same item. For
example, if widget.slddrw contains a drawing of widget.sldprt and no other item ID is specified for either
model, both will be stored in the item whose ID is widget.
Attributes
This utility will copy parameter values from SolidWorks® models to attributes in Teamcenter. The attribute
values that are copied are specified by the Teamcenter Integration for SolidWorks® mapping file. The default
mapping file is swim.xml in the Teamcenter Integration for SolidWorks® installation directory.
If a model was skipped during the file import step because its item revision already has a dataset for the
model, it will also be skipped during the step that copies attribute values. Specifying the –overwrite, or -
revise option will ensure no models are skipped.
BOMs
BOMs will be created or updated by this utility. The types of models that are added to the BOMs, and the
BOMs that are affected, are specified by the Teamcenter Integration for SolidWorks® mapping file. The
default mapping file is swim.xml in the Teamcenter Integration for SolidWorks® installation directory.
BOMs are precise by default. This can be changed by setting the iman.precisebom preference, described
in the swim.properties file in the Teamcenter Integration for SolidWorks® installation directory.
If a model was skipped during the file import step because its item revision already has a dataset for the
model, it will also be skipped during the step that updates BOMs. Specifying the -overwrite, or -revise option
will ensure no models are skipped.
Configurations and Design Tables
By default, Teamcenter items, item revisions, and datasets are created only for SolidWorks® master
documents, and those non-master configurations which are referenced by a higher-level parent model which is
itself imported. This behavior can be changed with the –all_configurations option, such that

3-12
Utility Functions

additional, unreferenced configurations within each document are also saved as items. When specified,
swimbulkimport creates separate items for all configurations, except for those excluded by the
sw.configurations.masters, sw.configurations.master.document.same, and
sw.configurations.hide user preferences.
A dataset that represents a SolidWorks® configuration is given the same name as the configuration. The
dataset for a SolidWorks® document is given the same name as the document.
Configurations created by a SolidWorks® design table are handled in the same way as other configurations
within a document. If the configurations are saved separately, by means of the
sw.configurations.default option in swim.properties or by adding their names to instruction files, each
design table member is treated as a model in its own right. An item, item revision, and dataset will be created
for it, although the SolidWorks® file will be stored only in the dataset for the document.

Toolbox Parts
The swimbulkimport utility must be executed on a system with SolidWorks® Toolbox installed and configured,
in order for the sw2Tbx datasets to be created for the Toolbox parts. Toolbox parts cannot be imported
directly, as top-level objects. They are only imported when used as components within an assembly, and that
assembly is imported.

Auxiliary Files
The swimbulkimport utility will not create and import auxiliary files when importing models even if an auxiliary
file map exists in the swim.xml. A SolidWorks® session is required to generate those file and for performance
reasons, the swimbulkimport utility does not start a SolidWorks® session. If auxiliary files are required, then
configure the Teamcenter Dispatcher framework to generate them.
Instruction Files
An instruction file is a text file that lists SolidWorks® files and configuration to import. When used with the –
no_gui option, only the models listed in the instruction file will be imported. If a dependency is not specified in
the instruction file, that dependency will not be imported. The best way to generate a template instruction file
for use with the import is to export the instruction file from the Bulk Import user interface.
Each line in the file should contain the path to a file. All files must be in the same folder. Blank lines and
comments are also allowed. The comment character is #. Any text between the comment character and the
end of the line will be ignored.
If the path to a file or directory contains spaces, it must be enclosed in double quotes. For example, the
following path does not have to be quoted:
D:\Models\widget.sldprt
but this path must be quoted:
"D:\Sw Models\widget.sldprt"
The path to a SolidWorks® model may be followed by several optional arguments on the same line. Each
argument has the form keyword=value, where keyword is one of the following:
configuration The value is the name of a SolidWorks® configuration. If this option is specified, this line
in the instruction file indicates the configuration is to be treated as a separate model in
Teamcenter, distinct from its document. Without this option, this line in the instruction
file refers to the document.

3-13
Utility Functions

dataset_desc The value is the dataset description. This is ignored if the dataset already exists.
document The value is the name of a SolidWorks® document. This is the same as the base name
of the file, without any extension or path. For example, the document name for the file
widget.sldprt is widget. This option is redundant if the file name is given. It cannot be
used to rename the model.
item_desc The value is the item description. This is ignored if the item already exists.
item_name The value is the item name. This is ignored if the item already exists.
item_id The value is the item ID.
item_revision_id The value is the revision level.
item_type The value is the item type. For best results, item_type should always be specified.
model_type The value is the six-letter extension that identifies the SolidWorks® model type. For
example, the type of a model stored in the file widget.sldprt or widget.prt is sldprt. This
option is redundant if the file name is given. It cannot be used to change the type of the
model.
property[class[:type].name]
The property keyword is used to specify Teamcenter properties other than the keyword
properties listed above. The class[:type].name notation specifies the Teamcenter type to
which the property belongs. Refer to the pdm_name section under Attribute Mapping for
details on the supported syntax. If the property is an array, the value must be included
in curly braces {} and comma separated. If required properties are attached to the target
item type, via Teamcenter configuration, then the property keyword may be required in
order to import CAD models with this utility. If a value contains spaces, it must be
enclosed in double quotes.

If a value contains the space, #, or = characters, then the value must be enclosed in double quotes. Double
quote characters within the value must use the \ character to escape the double quote.
The SolidWorks® file name is not required if the document and model_type options are included on the line.
Although these two options are not sufficient to identify the file to load, they can be used to refer to a model
that is loaded implicitly or explicitly by a file specified elsewhere in the arguments given to swimbulkimport. For
example, suppose three different revisions of widget.sldprt are stored in directories c:\reva, c:\revb, and c:\revc,
and a single instruction file c:\widget.txt has been created to specify the item ID to use for the model:
document=widget model_type=sldprt item_id=184786 item_type=Item
The swimbulkimport utility can then be executed three times to load the revisions:
swimbulkimport –u=infodba –p=infodba –revise c:\widget.txt c:\reva\widget.sldprt
swimbulkimport –u=infodba –p=infodba –revise c:\widget.txt c:\revb\widget.sldprt
swimbulkimport –u=infodba –p=infodba –revise c:\widget.txt c:\revc\widget.sldprt
In each case, the path to the model’s file is specified on the command line. The model identified in the
instruction file depends on the file that the utility loads.
Another simple instruction file is shown below.
# Sample swimbulkimport instruction file
D:\jjs\models
D:\jjs\bolts\bolt.sldprt item_id=702283 item_type=”Item” item_desc="Bolt design table"

3-14
Utility Functions

document=bolt configuration=BOLT_A model_type=sldprt item_id=702284 item_type=”Item”


document=bolt configuration=BOLT_B model_type=sldprt item_id=702285 item_type=”Item”
document=bolt configuration=BOLT_C model_type=sldprt item_id=702286 item_type=”Item”
The first line is a comment. The second line specifies a directory containing the models to be imported. The
swimbulkimport utility will load all SolidWorks® models that it finds in that directory. The third line specifies a
SolidWorks® part file bolt.sldprt. Two optional arguments appear on this line to specify the model’s item ID
and, if the item has to be created, a description to include with the item.
In this example, suppose bolt.sldprt contains a design table. The user wants to specify the item ID where each
configuration is to be stored, which is what the last three lines accomplish. Since the file name alone cannot
identify the individual configurations, the last three lines use the document, configuration and model_type
keywords to identify these models.
The following instruction file specifies MultiField Key values for the vendor and the item name.
C:\work\widget.prt.5 item_type="ITI9_PropItem" item_id="DK_Widget1"
property[Item:ITI9_PropItem.iti9_name]="Widget 1" property[Item:ITI9_PropItem.iti9_Vendor]="Widgets_R_Us"

The instruction file below provides further examples of property keyword usage:
D:\Work_Dir\A2.sldasm item_type="ITI9_PropItem" property[Item:Ipm9_AllPropItem.ipm9_dateArray]="{15-Oct-2012
08:55,12-Jan-2012 05:14,25-Mar-2012 06:20}" "property[ItemRevision
Master:Ipm9_AllPropItemRevisionMaster.user_data_1]"="data1" "property[Item Master.user_data_2]"="data2"
property[ItemRevision:Ipm9_AllPropItemRevision.ipm9_cascadingLOV]="Detroit"
D:\Work_Dir\P3.sldasm item_type="ITI9_PropItem" property[Item:Ipm9_AllPropItem.ipm9_dateArray]="{15-Oct-2012
12:32,12-Jan-2012 05:14,25-Mar-2012 06:20}" "property[ItemRevision
Master:Ipm9_AllPropItemRevisionMaster.user_data_1]"="data1" "property[Item Master.user_data_2]"="data2"
property[ItemRevision:Ipm9_AllPropItemRevision.ipm9_cascadingLOV]="Boston"
D:\Work_Dir\P4.sldasm item_type="ITI9_PropItem" property[Item:Ipm9_AllPropItem.ipm9_dateArray]="{15-Oct-2012
14:55,12-Jan-2012 05:14,25-Mar-2012 06:20}" "property[ItemRevision
Master:Ipm9_AllPropItemRevisionMaster.user_data_1]"="data1" "property[Item Master.user_data_2]"="data2"
property[ItemRevision:Ipm9_AllPropItemRevision.ipm9_cascadingLOV]="Mumbai"

Examples
The following example shows a simple use of this bulk import utility when using the –no_gui option.
swimbulkimport –u=infodba –p=infodba –no_gui c:\SwMdls
This command will load the latest version of each SolidWorks® model from the c:\SwMdls directory into
Teamcenter, but it will skip any model that already has a dataset in Teamcenter. For the models that are
imported, new items, item revisions, and datasets will be created as needed, attribute values will be copied to
Teamcenter and BOMs will be created or updated.
To force all models to be imported, use the –overwrite option:
swimbulkimport –u=infodba –p=infodba –no_gui –overwrite c:\SwMdls
For items that already exist, the models will be imported into each item’s latest revision, replacing SolidWorks®
model files that may have been imported previously.
If a new item revision should be created for those items that already exist, include the –revise option:
swimbulkimport –u=infodba –p=infodba –no_gui -revise c:\SwMdls
This command carries out the same operations as in the previous example, including creation of new items for
models that have not been imported previously. New revisions are created for existing items.

3-15
Utility Functions

Limitations
The SWIM bulk importer does not start a session of SolidWorks®. Instead it uses the SolidWorks® Document
Manager API to rapidly interrogate and modify files. Consequently there are some limitations with the bulk
importer:
• The bulk import will not start if a SolidWorks® session is running on the system.
• All files must be in the selected directory. The only exception is toolbox parts, which must be in the
directory specified by the sw.toolbox.dirs preference in swim.cfg.
• The bulk import utility recognizes existing models in several different ways:
o If the model name is found in the swim.txr index file in the integration’s cache directory, its
unique identifiers are read from the file.
o If the model name is not found in the swim.txr file, but its key properties are available via user
entry (in the graphical mode of operation), in an instruction file, or as mapped CAD properties,
the existing datasets, revisions, and items are found using the key property values
o As a last resort, the integration searches Teamcenter for a dataset with the same type and
name. If at least one matching dataset is found, then the integration will link the incoming model
to the first dataset with the same type and name.
Failure to understand and account for these algorithms can lead to saving the same model under
different items in Teamcenter, as in the following scenario:
• A customer has multiple top-level SolidWorks® assemblies stored in different folders. His goal
is to import all of the assemblies into Teamcenter, using the bulk import utility. One or more
parts is reused as a component by each of the top-level assemblies to be imported.
• The utility is executed on the first assembly, by selecting its directory as the source for the
import operation. The reused component is assigned a new item ID, triggering a rename of the
CAD model to match the item ID. During the import, the swim.txr file is created in the first
assembly’s directory, and accurately records the new model name and item ID of the reused
component.
• The utility is then executed on the second assembly, by selecting its directory as the source for
the operation. In this directory, the reused component exists with its original file name, and
there is no recognition that the part has already been imported to Teamcenter under a different
name. The bulk import utility will create a new item and a new dataset for the part, and in
Teamcenter the component becomes replicated instead of reused.
In summary, the bulk import utility has no ability to “remember” what was done in a previous invocation,
and this makes it unsuitable for any type of data migration usage. It is intended for small-scale, ad hoc
import and supplier collaboration.
• For sites managing toolbox files as SolidWorks® Toolbox datasets in Teamcenter, the toolbox files
must not be in the work folder or they will become a SolidWorks® Part dataset in Teamcenter. This
may cause problems during future Save operations. If a toolbox part has not been instantiated such
that a configuration is created in the SolidWorks® toolbox, than the toolbox part cannot be imported.
The parent assembly must be opened into SolidWorks® and saved to disk before the bulk import.
• SolidWorks® 2004 and earlier files cannot be imported – These old files cannot be read. The old files
are detected and the user will be advised to open and save models with a newer version of
SolidWorks®.

3-16
Utility Functions

• Older SolidWorks® files do not contain the document manager information required to obtain the length
unit of measure or positional information. Upgrade the files to the current SolidWorks® version before
importing them, so that the integration can properly create and update information in the Teamcenter
BOM. The SolidWorks® TaskScheduler utility is ideally suited for this purpose. Use the Convert Files
task:

Figure 14 - The SolidWorks TaskScheduler

• Assembly configurations which are renamed by the document manager API as part of the import
process must be opened and saved to disk, from SolidWorks®, before they can be imported again.
The most common scenarios in which this limitation may be encountered are:
o The user renames an assembly configuration (via the New or Replace buttons) within the bulk
import dialog, and then decides to cancel the operation. He must open the renamed models in
SolidWorks® and save them back to disk, before attempting to import them again.
o The user renames an assembly configuration as described in the last bullet, as part of a
complete import operation. He then exports the model from Teamcenter to a disk location,
without opening it in a SolidWorks® session. He then attempts to bulk-import the exported
model under a new Item ID, as part of a clone operation.
• The bulk import cannot generate auxiliary files such at JPGs, Tiff, and DirectModel (JT).
• The bulk import cannot identify relationships from virtual components to non-virtual components. All
models will be imported, but the dependencies of virtual components will not be fetched during an open
operation until an interactive save to Teamcenter has been performed.
• The bulk importer always creates new items or modifies existing items. The bulk import cannot perform
a Save As that would create a based on relation in Teamcenter. Similarly, the Teamcenter SaveAs
operation descriptor is not applied.

3-17
Utility Functions

Renaming SolidWorks® Models in Teamcenter


Renaming models stored in Teamcenter is not generally recommended because it is common that the process
cannot be completed. There are two key requirements for renaming any model managed by Teamcenter:
• All revisions of the model must be renamed
• All parent model revisions must be updated to reference to the renamed model
These actions cannot be completed successfully if any of the models is checked out, access restricted, or will
not open into SolidWorks®. The utilities provided verify the checkouts and access restrictions, but cannot
verify that models can be opened into SolidWorks®. If models cannot be opened, the renaming processes will
fail and may require cleanup.
The renaming of models is usually desired because the filename is “smart”, in the sense that it contains key
strings which are used by the organization to find models by some set of criteria. Rather than have smart
filenames, it is recommended that you leverage Teamcenter to store meaningful identifiers in the Item Name,
and use Teamcenter-assigned values for both the item IDs and CAD model names. The Item Name can be
changed at any time without impacting Teamcenter or the integration. The Item Name appears in all
Teamcenter interfaces and all integration dialogs, and can be used for searching data in Teamcenter. It’s even
possible to have a different Item Name for each Item Revision.
If renaming of models is absolutely required, we recommend the renaming be restricted to WIP models.

Renaming SolidWorks® Models in Teamcenter with swimrename


The swimrename utility renames SolidWorks® models and their datasets in Teamcenter. This interactive utility
will check out a model from Teamcenter, open it in SolidWorks®, rename the model and save it back to
Teamcenter. It also checks out, updates and saves all of the SolidWorks® models that use the renamed
model, and optionally changes the item ID and the names of other objects to match the new name.
Usage
swimrename [-login] [-u=username –p=password [-g=group]] [-help]
[-project=project_id]
[-no_gui]
-item=itemid [-rev=revision] –type=type
-old_name=oldname -new_name=newname
[-work_dir=directory]
[-no_autorename]
[-autorename_item_id=true|false]
[-autorename_item_name=true|false]
[-autorename_other=true|false]
[-autorename_other_exact_length=true|false]
[-servername name]
[-progress_file=outputfile] [inputfile]
Description
Before running the swimrename utility, all models that will be renamed and all of the models that use them
must be checked in to Teamcenter. The swimrename utility will stop with an error if it finds that a model to be
renamed, or a model that uses a renamed model, is reserved.

3-18
Utility Functions

A log file named swimrename.txt is always produced containing information about the actions carried out
during the renaming process. This log is located in the Teamcenter Integration for SolidWorks® installation
directory.
The arguments for swimrename are described below.
-autorename_item_id=true | false
Specifies whether the item ID should be changed to match the model name (optional). If
true, the item ID is changed to the new model name if the old item ID matches the old
model name, ignoring case. If false, the item ID is not changed. Specifying
-no_autorename also sets this option to false. This option can follow -no_autorename
on the command line to override -no_autorename. If not specified, the default is given
by the iman.autorename.itemid user preference (see the swim.properties file in the
installation directory for a description of user preferences).
-autorename_item_name=true | false
Specifies whether the item name should be changed to match the model name
(optional). If true, the item name and item revision name are changed to the new model
name if their old names match the old model name, ignoring case. If false, the names
are not changed. Specifying -no_autorename also sets this option to false. This option
can follow -no_autorename on the command line to override -no_autorename. If not
specified, the default is given by the iman.autorename.itemname user preference (see
the swim.properties file in the installation directory for a description of user preferences).
-autorename_other=true | false
Specifies whether the names of other objects within the item or item revisions should be
changed to match the model name (optional). Examples of “other” objects include
forms, BOM views, and non-SolidWorks® datasets and their named references, i.e. any
Teamcenter object in an item or item revision that is not a SolidWorks® dataset. When
true, these other objects are renamed to the new model name if their old names match
the old model name, ignoring case (the -autorename_other_exact_length option
determines how the names are matched). When false, the names are not changed.
Specifying -no_autorename also sets this option to false. This option can follow
-no_autorename on the command line to override -no_autorename. If not specified, the
default is given by the iman.autorename.other user preference (see the swim.properties
file in the installation directory for a description of user preferences).
-autorename_other_exact_length=true | false
Specifies how to match names when deciding whether to rename other objects in the
item or item revisions (optional). When true, the name of a Teamcenter object matches
the SolidWorks® model name if both names match character-for-character, ignoring
case, and are exactly the same length (for named references, the file name without
extension is tested). When false, the names match if the object’s name starts with the
model name, ignoring case. For example, suppose the model’s name is WIDGET. If
-autorename_other_exact_length is true, an item master form named WIDGET will
match the model name, but not an item revision master form named WIDGET/A. If
-autorename_other_exact_length is false, both forms match the model’s name. This
option only affects the “other” objects in the item and item revisions when
-autorename_other is true. Exact length is always used when matching the model name
to the item ID, item name, or item revision name. If not specified, the default is given by
the iman.autorename.other.exactlength user preference (see the swim.properties file in
the installation directory for a description of user preferences).

3-19
Utility Functions

-g=group The Teamcenter group (optional). Ignored when -login is specified.


-help Prints usage information and quits (optional).
-item=itemid
The item ID of the model to be renamed.
-login Uses the Teamcenter login dialog. When this option is specified, the -u, -p, -g, and
-servername options are ignored. Use –login to avoid having to escape special
characters that may be included in username, password, group or role.
-servername name
The Teamcenter server name. If not specified, the default server is that of the first
server in the client_swim.properties file, found in the integration’s client
installation directory. –servername is ignored when –login is specified.
-new_name=newname
The new name for the SolidWorks® model. Do not include the file extension.
-no_gui Disables the graphical user interaction (optional). Dialogs and prompts are not
displayed. All alert messages are written to the log file.
-no_autorename
Turns off automatic renaming of the item, item revisions, and other objects (optional).
This is the same as setting -autorename_item_id, -autorename_item_name, and
-autorename_other to false.
-old_name=oldname
The old name for the SolidWorks® model. Do not include the file extension.
-p=password The Teamcenter password. Ignored when -login is specified.
-project=project_id
Specifies the project to use when connection to Teamcenter (optional).
-progress_file=outputfile
The absolute path to a text file that this program will create to record its progress
(optional). If an error occurs, the program can be restarted using the file as the inputfile
argument.
-type=type The six-letter SolidWorks® file extension that identifies the type of the model, such as
sldasm. Alternatively, this may also be the dataset type, such as SWAsm.
-u=username The user’s Teamcenter login name. Ignored when -login is specified.
-work_dir=directory
The absolute path to a temporary working directory (optional). This directory will be
created if it does not exist. If the directory does exist, it must be empty. You will usually
want to use a directory that is not the same as the directory where you start the
swimrename utility. If the path is not specified, then the user’s temp directory will be
used.

3-20
Utility Functions

Suppressing the GUI


By default the swimrename utility runs in an interactive mode with a dialog that lists all the models involved in
the rename. Additionally, the interactive mode displays alerts and requires the user to respond. When –
no_gui is specified, the dialog and all alerts are suppressed.

Figure 15 Dialog listing all Item Revisions involved in the rename.


The symbol appears in the first column to indicate that a model cannot be checked out. A flyover for the
icon provides a hint as to why the model cannot be checked out. The Checked Out? And Release Status
columns also guide the user.
The Rename button remains disabled until the first column does not contain the symbol. Once the Rename
button is enabled, the user can proceed to rename all revisions of the model and update all revisions of the
parent models. Use the Write to file… button to obtain an HTML output of the dialog contents.
Examples
Suppose an assembly named “cylinder” is stored in an item whose item ID is 0000753, and it is decided to
rename the model to match the item ID. The command to execute this change might look something like this:
swimrename –u=infodba –p=infodba –item=0000753 \
–type=sldprt –old_name=cylinder –new_name=0000753 \
–work_dir=d:\tmp –progress_file=c:\restart1.txt
All revisions of cylinder in item 0000753 are renamed to 0000753. A directory d:\tmp is used as a temporary
space for SolidWorks® to work on these models, and a file c:\restart1.txt will be created in case the command
aborts before all of the models are renamed.

3-21
Utility Functions

Because the –progress_file option is used in the example above, swimrename can be restarted if an error
occurs. The command to execute swimrename is the same as before, but the output file created with the –
progress_file option above is now given as an input to swimrename:
swimrename –u=infodba –p=infodba –item=0000753 \
–type=sldprt –old_name=CYLINDER –new_name=0000753 \
–work_dir=d:\tmp –progress_file=c:\restart2.txt c:\restart1.txt
Note that this command also creates a new text file, c:\restart2.txt, which can be used to restart swimrename
again if another error occurs.
Suppose it is later decided to rename part 0000753 to 5000753 after a drawing named 0000753 has been
added to the same item. The part and the drawing should both be renamed, but you must run swimrename
twice to do this. Either could be renamed first, but it may be desirable to avoid changing the item ID until both
models are renamed. The two runs of swimrename might look like this:
swimrename –u=infodba –p=infodba –item=0000753 \
–type=sldprt –old_name=0000753 –new_name=5000753 –no_autorename \
–work_dir=d:\tmp –progress_file=c:\restart.txt
swimrename –u=infodba –p=infodba –item=0000753 \
–type=slddrw –old_name=0000753 –new_name=5000753 \
–work_dir=d:\tmp –progress_file=c:\restart.txt
Notice that -no_autorename is used in the first run, when renaming the part. This prevents the item ID from
changing and allows the second run to use almost the same arguments to rename the drawing, except for
changing the -type argument and dropping -no_autorename. At the end of the second run, swimrename
will change the item ID to 5000753.

Renaming SolidWorks® Models in Teamcenter with


SolidWorks→Rename
The SolidWorks→Rename function in the Teamcenter Rich Client is disabled OOTB for all users. Due to the
challenges of renaming models in Teamcenter, it is recommended that renaming only be done by
administrators. To enable SolidWorks→Rename, set the Teamcenter preference
SW2_rac_rename_enable to true, as described elsewhere in this document. SolidWorks→Rename is
a simplified way of executing the swimrename utility.

Select a SolidWorks® dataset in the Teamcenter Rich Client, then select SolidWorks→Rename to invoke the
rename dialog. The New Model Name must be specified. The remaining three options correspond to similar
autorename preferences used by the swimrename utility:
• Apply to Item Name – set autrename_item_name=true when swimrename is invoked
• Apply to Item ID – set autorename_item_id=true when swimrename is invoked
• Apply to Other – set autorename_other=true when swimrename is invoked

3-22
Utility Functions

Figure 16 Teamcenter Rename dialog

Note:
The integration’s SolidWorks→Rename function does not perform automatic refresh on related objects before
proceeding. It is the user’s responsibility to ensure that all objects are fully refreshed before beginning the
operation. This may require explicitly refreshing not only the dataset, but also the item, item revision, master
forms, and any custom forms which are attached to the item or revision.

3-23
Best Practice Recommendations

Chapter 4 Best Practice Recommendations

Properties display in the Save As, Save All, Save


Checkouts and Teamcenter New Dialogs
The Save and Teamcenter New dialogs have two properties panels: Required Properties and Optional
Properties. Initially, these panels contain only the properties required by OOTB Teamcenter. OOTB
Required Properties are Item Type, Item ID, Item Revision, and Item Name. Both sets of properties may
be distributed across the Item, master forms, and dataset types:

Figure 17 - OOTB Teamcenter Required and Optional properties

The visibility and read/write status of each property are controlled by Teamcenter Operation Descriptors, which
are defined in both OOTB and custom BMIDE templates. The integration recognizes and enforces the Create
and the SaveAs operation descriptors. Thus the appearance and editable status of a given attribute may be
different in the various dialogs, based on the context of the operation. Specifically:

4-1
Best Practice Recommendations

Teamcenter New The Create operation descriptor is enforced.


Save As Either the Create or the SaveAs operation descriptor may be enforced. Because the
Save As dialog is used for multiple operations, the integration automatically applies
the appropriate descriptor. If an item or revision is being created for the first time, the
Create operation descriptor is applied. If an existing item is being saved to a new
item, the SaveAs descriptor is applied. If a new version of an existing item revision is
being saved, no descriptor is applied and no attributes may be assigned or modified.
See Enabling property modification for existing item revisions for more information on
the last operation.
Save All The Save All dialog has the same behavior as the Save As dialog, with respect to
operation descriptors.
Save Checkouts If an item is being created for the first time, the Create descriptor is applied. If an
existing item revision is being saved to a new version, no descriptor is applied and no
attributes may be assigned or modified. See Enabling property modification for
existing item revisions for more information on the latter operation.

In all Save dialogs, the icon appears in the left most column when the model is selected for save, but one or
more required properties has not been assigned a value.

Required and Optional properties may be included in attribute mappings. When an attribute mapping exists
for a property, its value in the properties panel will initially be determined by the value of the mapped
Solidworks® property. Mapped properties have the advantage of being visible to the user from within
Solidworks®. When a user assigns a value to a mapped property in the properties panel, that value is written
back into the Solidworks® file when the Save button is selected7. Read more about attribute mapping in the
Attribute Mapping section of this document.

Note:
Create descriptors can differ between Item Types.
Models existing in Teamcenter without values for required properties can be saved without specifying a value.
Do not change the value of a mapped function-driven property in the Save dialog. The functional value will
persist and user changes in the Save dialog will not persist.
Limit required create descriptors to properties which CAD designers know at time of first save. An excessive
number of required properties might discourage designers from saving data to Teamcenter.

7Attributes which are mapped in the pdmtocad, or both, direction should generally be given create descriptors in
Teamcenter, so they appear on the properties panel during save. This allows the integration to synchronize the CAD
parameter values with the assigned Teamcenter values at time of save, which can significantly improve performance of
subsequent Open operations.

4-2
Best Practice Recommendations

Configurations
Integration preferences related to configurations
Every SolidWorks® part or assembly has one or more configurations. Not all configurations are used the
same way. The integration provides several preferences intended to help customers manage and resolve
various types of conflicts and inconsistencies in their SolidWorks® data:

• Set sw.configuration.default = all. This default preference setting tells the Integration that all
referenced configurations should be managed as items in Teamcenter, unless hidden by another
preference.
• Populate sw.configurations.hide with configuration names that should never be managed. Train
designers to use unmanaged configuration names when they create representations, to prevent
unwanted configurations from being saved into Teamcenter. It can be difficult to remove data from
Teamcenter, so it is best to establish practices that avoid creating the data in the first place.
Alternatively, consider using sw.configurations.keep to control which configurations may be
managed in Teamcenter. The choice of which preference to use depends largely upon how easily
identifiable the SolidWorks® data is, by naming convention.
• Set sw.configurations.master.document.same = true, to handle configurations with the same
name with the document. Data such as this often comes from Toolbox (see Toolbox documentation
elsewhere in this document) or suppliers. In such cases the document usually contains only the single
configuration and no other “Master Configurations”, thus managing the single configuration with the
document is desired.

Solidworks® search paths


SolidWorks® searches for assembly components and other references in several different ways. At times it
will use historical path information embedded within the CAD models themselves, and such stored paths may
not be valid on all users’ client workstations. For maximum consistency and reliability, it is highly
recommended to configure a combination of integration and SolidWorks® preferences such that each
integration client session uses a single, fixed directory location for all Teamcenter load and save operations.
The recommended integration preferences are:

checkout.exportdirectory Set this preference in the master copy of swim.properties. Note that
system environment variables may be used to enable portability of the
resolved directory path across all client workstations. For example:
checkout.exportdirectory=${USERPROFILE}\\sw.

checkout.exportdirectory.enable Set this preference to false so that users cannot make ad hoc changes to
the integration’s cache directory. With this setting, the integration will also
detect and block attempts to save new files from outside the configured

4-3
Best Practice Recommendations

directory location, which helps to prevent models with stale path


information from being saved to Teamcenter.

The recommended SolidWorks® preference is found under Tools | Options | File Locations | Referenced
Documents, and should be set to the same value as the checkout.exportdirectory integration preference.
For example:

Figure 18 - Recommended SolidWorks search path preference

SolidWorks® External References


SolidWorks® creates an external reference between documents when the parent document depends on the
feature definition of the child document. When the child document is modified, the parent document is
modified too. The integration detects external references when saving the data to Teamcenter. However, if a
user renames the child in SolidWorks® or the integration Save dialog, the external reference will not be
updated. The relationship will be broken. To “save-as” data with external references, use the SolidWorks®
Pack and Go utility, then import the renamed data into Teamcenter via interactive Save or Bulk Import.
Another option is to disable external references by selecting “Do not create references external to the model”
from SolidWorks® Tools→Options→System Options→External References dialog.

SolidWorks® Toolbox
SolidWorks® toolbox is a library of fasteners, nuts, bolts, screws, bearings, and more. The toolbox is highly
integrated into SolidWorks®. SolidWorks® enables the sizing of the components at the time of instantiation
into SolidWorks® assemblies. The toolbox is a powerful tool, and its files are best not managed by
Teamcenter, but left to SolidWorks® to manage. On the other hand, Teamcenter requires Items to exist for the
toolbox parts, for life cycle management within Teamcenter.

4-4
Best Practice Recommendations

To enable Teamcenter knowledge of the toolbox parts, the SolidWorks® integration to Teamcenter creates
Items, Item revisions, and Datasets for toolbox configurations, but does not store the files. A sw2Tbx dataset
type is used to represent the toolbox parts. The associated items appear in the BVR of parent assemblies.
Toolbox parts are represented by the icon in the integration dialogs.

SolidWorks® SpeedPak
Speedpak creates a simplified configuration of an assembly to improve assembly performance. Another
benefit of SpeedPak is assembly sharing. The integration does not fully support SpeedPak configurations.
With this release, it is best if SpeedPak configurations are not managed with Teamcenter. One means to avoid
saving SpeedPak configurations is to set sw.configuration.hide = *speedpak. When using this setting, if a
SpeedPak configuration is active at the time of save, all references to child components will be lost.

SolidWorks® Virtual Components


Virtual components are internal to the SolidWorks® assembly file instead of in separate subassembly or part
files. The integration hides virtual components from the user. The child relationships of a virtual component
are assumed by the parent assembly. JT files cannot be generated for virtual components. When a virtual
component is made external the integration will manage the external copy. When an external component is
made virtual the integration will hide the internal copy. Once a component is managed by the integration the
recommendation is to not virtualize the component as changes to the virtual component will not be reflected in
Teamcenter.

Multisite
Upgrading the Teamcenter database for multi-site
Upgrading the database is only required for sites that have saved data with Integration version 9.1.0 or earlier.
Sites that have only deployed version 9.2.0 and later do not need to run the utility. The upgrade adds
SW2_configuration relations into the database. These relations are required to enable complete multi-site
transfer of a document and all related configurations. Starting with integration version 9.2.0 of the integration,
the SW2_configuration relations are created automatically whenever data is saved or imported by the
Integration.

4-5
Best Practice Recommendations

Usage

swim_upgrade_database -u=user -p=password


-operation=sw2_configuration
[-statistics]
[-dryrun]
[-debug=filename]
[-log=filename]
[-help]
Description
The upgrade utility creates SW2_configuration GRM relations in the database where they do not already exist.
The SW2_configuration relations are most important to customers who transfer SolidWork®s data via
Teamcenter multi-site. Failure to run the utility could result in duplicated configuration items between sites.
The swim_upgrade_database utility must be run on the server by a Teamcenter administrator, from a
Teamcenter command line.
-debug=filename
An optional argument to specify the filename and path to record debug information. This
generates a very large file. It should only be used if error messages are encountered
during –dryrun. The debug log should be sent for customer support.
-dryrun
An optional argument. When specified, the utility does not modify the database. This
option is used to analyze the operation before execution to modify the database.
-help Prints usage information and quits (optional).
-log=filename
An optional argument to specify the filename and path where the utility records relations
that it failed to process.
-operation=sw2_configuration
Required argument to specify the operation to be performed. At this time
sw2_configuration is the only supported operation.
-p=password The Teamcenter password.
Windows: Password may contain special characters as long as the password is
enclosed in double quotes. Double quotes cannot be contained in the password string
UNIX: Passwords may contain special characters as long as they are escaped with \
(backslash character). Passwords cannot contain the characters $ { } “(double quote) or
`(grave accent)
-statistics
An optional argument that outputs the count of each GRM relation the utility queries. No
other processing will occur when this option is specified. Execute the operation in with
this option prior to –dryrun to understand the size of the data to update.
-u username The user’s Teamcenter login name.

4-6
Best Practice Recommendations

Configuring Teamcenter Multi-Site to Export SolidWorks® Models


If you are using Teamcenter Multi-Site to export items containing SolidWorks® datasets, you must include the
following relation types in the references to be exported:
IMAN_master_form
IMAN_Rendering
IMAN_specification
TXD_long_name_relation

You should add these types to your TC_relation_required_on_export site preference. These additional
types should be included when exporting models with the other SolidWorks® models on which they depend:
SWIM_dependency
SWIM_mandatory_dependency
SWIM_master_dependency
SWIM_suppressed_dependency
SW2_configuration

When exporting items using the Tools | Export | Objects command in the Teamcenter Rich Client’s Navigator
application, or when importing items with the Tools | Import | Remote command, remember to include the
relation types above in the references shown in the Advanced tab of the Export Preferences dialog or Import
Remote Options dialog, respectively.

Configuring Teamcenter Multi-Site for Transferring Ownership of


SolidWorks® Models
If users are allowed to transfer ownership of SolidWorks® models from remote sites to your site, first configure
Multi-Site to replicate items containing SolidWorks® models, remembering when exporting and importing items
to include the relation types described in the previous section.
Before starting SolidWorks®, you may want to add a column to the Teamcenter Integration for SolidWorks®
dialogs so users can see the name of the site that owns each SolidWorks® model. Do this by adding the site
keyword to the list of columns defined by the table.columns.std user preference in the swim.properties
file. This user preference and others are described in the swim.properties file, which can be found in the
installation directory.
If you chose to add the Transfer Ownership command during installation, the command will appear in the
shortcut menu when the user right-clicks on a model in the Teamcenter Integration for SolidWorks® dialogs. If
this command does not appear in the shortcut menu, run the installer again, choosing a Custom installation
with only the Configure Client for Multi-Site option selected. Refer to the User Guide’s section on Using the
Shortcut Menu for more information on the Transfer Ownership command.

Restricted access to data


While opening CAD data from Teamcenter, and while saving CAD data to Teamcenter, the integration
identifies all models which are related to the top-level structured model (drawing, assembly, and configuration).
During Open and Save, Teamcenter relationships are expanded and traversed. During Save, the CAD session
is also interrogated to read its network of dependency relations.

4-7
Best Practice Recommendations

While expanding and traversing these relations, Teamcenter may encounter one or more components which
are inaccessible in one way or another. Common scenarios are:
• The item, item revision, dataset, or some combination of these, has been assigned to a project to which
the CAD user does not have read access.
• The item, item revision, dataset, or some combination thereof, has an ACL attached, or is owned by a
security-enabled group, that explicitly or implicitly denies read access to the CAD user.
• Any of the above objects was imported into the local database via MultiSite import, and has since been
deleted, leaving a stubbed reference in the local Teamcenter database. Teamcenter allows deletion of
replica data even though it is referenced by higher-level objects in the local database. When that
replica data is deleted, the reference remains.
• The user is saving an assembly which has suppressed components, and those suppressed
components have never existed in Teamcenter. This can occur when the components remain
suppressed the first time the assembly is saved to Teamcenter. Because they are not available in
session, the integration cannot save them to Teamcenter as items8.

Because inaccessible models may result from deliberate customer security practices, such as assignment to
secure projects, the integration does not consider them an error condition. Instead, it informs the user about
the situation during both Open and Save operations.

Opening a model with access restrictions


When a model with restricted components is opened from Teamcenter, the integration displays an
informational dialog, stating how many inaccessible dependencies were encountered. Depending upon the
user’s access to the objects involved in the operation, additional details such as Item ID and model name may
also appear in the dialog:

Figure 19 - Inaccessible object notification

The content of the secondary Details dialog will vary, based upon whether or not the user has DBA privileges.
For a non-DBA user, details about the restricted objects are omitted, and the following is displayed:

8 This situation can be prevented by setting checkin.ignoremissing = never in swim.properties. This is not the default
setting, because it is very common for customer data to contain “ghost references”, which are pointers to non-existent,
non-required dependencies. With the default setting of “prompt”, the integration warns the user about these missing
references, but does not prevent him from completing the save.

4-8
Best Practice Recommendations

Figure 20 - Inaccessible models warning dialog, user level

A DBA user will see additional information about the identity of these missing models. For example9:

Figure 21 - Inaccessible models warning dialog, admin level

9In this example, the item ID cannot be displayed because the access restriction is at the item level. If the item was
accessible, but the item revision and dataset were not, then the item ID would be reported.

4-9
Best Practice Recommendations

Saving a model with access restrictions


The integration does not display any special warnings when the assembly or drawing is checked out and saved
as a new dataset version. There is no risk of lost references in this case; the integration simply ignores
relationships to the inaccessible objects and does not alter them. The following dialog will appear, but this is a
general informational dialog that appears in several other contexts. It is not specific to restricted object
scenarios:

Figure 22 - general missing model warning dialog

When the model is being saved as a new revision, however, the integration displays a warning dialog:

Figure 23 - Revise with missing dependencies warning dialog

The Details button will display a secondary dialog that identifies the model(s) which have dependencies on the
inaccessible objects, and should therefore not be revised unless the user, or the Teamcenter Administrator,
has judged it safe to do so:

4-10
Best Practice Recommendations

Figure 24 - Revising a model with inaccessible dependencies

Proceeding with the Revise operation will usually result in an inconsistency between the Teamcenter Bill of
Materials and the integration’s CAD-specific dependency relationships, as shown in this example, where the
component “000396” was inaccessible to the CAD user who performed the Revise:

Figure 25 - Teamcenter Bill of Materials before revise

Figure 26 - Integration CAD relationships before revise

4-11
Best Practice Recommendations

Figure 27 - Teamcenter Bill of Materials after revise

Figure 28 - Integration CAD relationships after revise

The integration cannot create or maintain a CAD relationship between the new assembly revision and the
inaccessible component, because it cannot access it in the CAD session or in Teamcenter. Teamcenter itself
propagates the relationship to the new revision’s Bill of Materials, however.

4-12
Troubleshooting

Chapter 5 Troubleshooting

General guidelines
Logging
• Sometimes problems must be sent to Siemens GTAC for analysis. We will need a txdlog.txt file to
better understand the issue. To generate this file, add the following lines to the beginning of the
swim.properties file, on the client:
log.enable = true
log.file = c:\\temp\\txdlog.txt
log.suppress = 10000

The SolidWorks® session must be restarted after making this change, in order for the logging options
to take effect.

Each integration session will also produce a client_socket.log file. This file is written to the integration’s
installation directory on each client. The level of detail in the client_socket.log file can be increased by
setting sw.debugPrints=1 in the swim.cfg file.

• The Integration’s server component can be configured to write a log file by setting TXD_DEBUG as an
environment variable in the tcserver startup environment. The value assigned to the variable should be
the full path to a log file, including the file name itself. For example:

Figure 29 - Configuring the server log file

Reporting problems
• When submitting a case to GTAC, include enough detail to enable the assigned analyst to reproduce
the problem. This always requires a full description of the test case and data involved, and all available
log files. The minimum set required are the txdlog.txt file and client_socket.log file mentioned above,
but when Teamcenter server errors are involved, GTAC will also need the tcserver syslog file.

5-0
Troubleshooting

Note:
It is very important to provide all necessary information with the initial submission to GTAC. Incomplete or
ambiguous information will lead to unnecessary delay in resolving your problem.

Integration launch
If you have trouble starting SolidWorks®, or if SolidWorks® starts, but no Teamcenter Integration for
SolidWorks® sidebar tab appears:
• Make sure the minimum required build of SolidWorks® is installed. See the Installation Guide chapter
on Prerequisites for the Teamcenter Integration for SolidWorks® for more information.
• If the Teamcenter Integration for SolidWorks® sidebar tab does not appear in SolidWorks®, make sure
the Teamcenter add-in is enabled. In SolidWorks®, select Tools | Add-Ins to open the Add-Ins dialog.
Make sure the dialog shows the Teamcenter add-in in this list, and put a check next to its name. If the
dialog does not show the Teamcenter add-in, it may be necessary to repeat the client installation or you
can double click on %SWIM_DIR%/bin/ RegisterSwimAddin.bat, to re-register the integration with
SolidWorks®.
• Customers who had previously installed an older version of the integration (prior to version 8.1.0), may
need to remove the older version’s add-in. This older add-in will be labeled as “Teamcenter” in the
SolidWorks® dialog, as shown below:

5-1
Troubleshooting

Figure 30 Teamcenter add-in from older integration version


It should be removed by double clicking on %SWIM_DIR%/bin/Remove_cadscript.reg, after which
the add-in dialog should look like this:

5-2
Troubleshooting

Figure 31 Add-in dialog, after removal of older integration version


• Make sure any Windows paths specified for the JRE_DIR, IPR_DIR, or SWIM_DIR variables in scripts,
or in the user’s environment, do not have spaces. If necessary, use a command window and the MS-
DOS command dir /x to determine the short MS-DOS name for a file or director, and update all
scripts and environment variables to eliminate the spaces.
• Make sure the JRE_DIR variable in the %SWIM_DIR%/swimenv.bat script specifies the correct
installation directory for the Java runtime environment. This script is located in the installation directory
for the Teamcenter Integration for SolidWorks®. It is recommended to use the JRE that is installed with
the Teamcenter Rich Client.
• If the JRE_DIR variable is already defined in the user’s environment, it will take precedence over the
variable’s definition in the %SWIM_DIR%/swimenv.bat script. If the user prefers setting this variable
in his environment, make sure it is defined correctly, otherwise remove it from the user’s environment
so that the swimenv.bat definition takes effect.

5-3
Troubleshooting

Runtime problems
• If SolidWorks® models cannot be opened successfully at remote sites after export via Teamcenter
Multi-Site, make sure you have included the TXD_long_name_relation in the relation types that are
exported during Multi-Site operations.
• You may need to switch between different versions of the SolidWorks® integration, on a single client
workstation. This may be done by running the registration batch scripts RegisterSwimAddin.bat and
UnregisterSwimAddin.bat in the SWIM bin directory. If you are using Windows 7 you must run the
batch script as administrator (right click it and select “Run as Administrator”)
1. First unregister the currently active integration version by running UnregisterSwimAddin.bat in the
SWIM bin dir.
2. Next, go to the bin dir of the version you want to switch to and run RegisterSwimAddin.bat.
3. Start the integration using the version’s corresponding startsw.bat.
4. You can verify the change by selecting Tools | Addins in the SolidWorks® menu and hovering your
mouse over the Teamcenter add-in option. The tooltip that appears should display the integration
install directory of the version you switched to.
• When logging into Teamcenter from SolidWorks®, for the first time, users may see these dialogs:

Figure 32 - Attribute mapping warning message

5-4
Troubleshooting

The problem is explained in the dialog text itself, but sometimes causes confusion. This simply means that the
attribute map in the swim.xml file contains definitions that have not been loaded into Teamcenter, or have been
loaded incorrectly. Users will continue to see this dialog at each login until (a) the Administrator loads the
attribute mappings correctly or (b) the Adminstrator removes (or comments out) the attribute mappings from
the swim.xml file

5-5
5-0
Customization points

Chapter 6 Customization points

It is possible to implement custom Java code that the integration will execute when specific actions occur
within the integration. The code must be compiled into a SwimUserExits.class file and placed in the
<swim_dir>\com\transcendata\userexits folder. When the file exists in that location, the integration
will import and execute the implemented user exit methods. It is not required that all user exits be
implemented - any number of the user exits can be implemented from within the class file.
Start with the <swim_dir>\com\transcendata\userexits\SwimUserExits.txt file. It has an extensive
sample implementation. The comments within the file explain how to compile it, and the sample code indicates
how to use each user exit, process the XML, and formulate the proper return and response. User exits are
provided to augment the functionality provided by the integration. Customers can implement code to validate
user actions or customize actions performed by the integration.

Available User Exits


saveInit() This method is invoked before the Save, Teamcenter New, Clone and
swimbulkimport dialogs are displayed. The integration sends an XML file
containing the properties to be displayed in the Save dialog. The customization
returns an XML file listing new models and the property values to pre-populate when
the dialog is displayed.
saveItemId() This method is invoked when the user enters a value in the Item ID button in the
Save, Teamcenter New, Clone and swimbulkimport dialogs. The integration
sends an XML file containing the data in the save dialog and an indication of which
models were selected. The customization returns an XML file listing models to be
renamed, and the new Item IDs and Model Names to be assigned.
saveNew() This method is invoked when the user clicks on the New button in the Save,
Teamcenter New, Clone and swimbulkimport dialogs. The integration sends an
XML file containing the data in the save dialog and an indication of which models
were selected. The customization returns an XML file listing models to be renamed,
and the new Item IDs and Model Names to be assigned.
saveReplace() This method is invoked when the user clicks on the Replace button in the Save,
Teamcenter New, Clone and swimbulkimport dialogs. The Integration’s own
Replace dialog does not appear. The integration provides a XML file containing the
data in the save dialog, and an indication of which models were selected for
Replace. The customization returns an XML file listing models to be renamed, and
the new Item IDs and Model Names to be assigned.
saveValidation() This method is invoked when the user selects the Save button on the Save,
Teamcenter New, Clone and swimbulkimport dialogs, when the user selects the

6-1
Customization points

Validate button in the Clone and swimbulkimport dialogs, and when the
swimbulkimport utility is executed with the –no_gui option. The integration writes
the relevant information from the save dialog to an XML file for the customer code to
validate. The return is a Boolean and a value of true indicates the user exit
validation passed.

Sample code is provided in <SWIM_DIR>\com\transcendata\userexits\SwimUserExits.txt. The file


should be renamed to swimUserExits.java and compiled within the same directory. The sample code
demonstrates how to access the information in the XML files.

Integration generated XML


The integration generates an XML file before calling each user exit. The XML file contains the information
required for the user exit. For the save user exits, the content comes directly from the Save Dialog. The XML
file is generated in the user’s %TEMP% directory. The structure of the XML file is the same for each user exit.
The following is a description of the tags:

Tags
swim_user_exit
Root tag for the action being performed. Only one swim_user_exit tag will exist in the XML file. All other
tags are nested in the swim_user_exit tag. The following is a list of the attributes of the swim_user_exit
tag.
action This string specifies the action performed by the user, which corresponds action
occurring. Possible values are one of item id, new, replace, or validate.
after_checkin_action This string indicates which radio button has been selected in the Action
on Save panel of the Save dialog. Possible values are Delete Files, Retain
Files, Retain Files and Checkouts.
group This string contains the group to which the current user’s session is assigned.
item_id_value This string contains the text entered in the Item ID field. This attribute is only valid
for the saveItemId() user exit.
item_id_value_existing A yes or no string which indicates if the Item specified by
item_id_value is existing in Teamcenter. A value of yes indicates the Item
already exists in Teamcenter. This attribute is only valid for the saveItemId() user
exit.
operation This string specifies the operation being performed by the user. Operation values
include: CHECKIN_CHECKOUTS, CHECKIN_AS, CHECKIN_ALL, REGISTER
NEW, SAVE_AS_COPY, RMB->SAVE_AS, MAKE_INDEPENDENT, CLONE,
BULK_IMPORT.
project This string specifies the project to which the current user’s session is set.

6-2
Customization points

role This string specifies the current user’s role in his group.
user_id This string contains the current’ user’s Teamcenter login ID.

auxiliary_files
This is an optional sub tag of the swim_user_exit tag. It does not have any attributes. It contains one or
more cadtopdm_control tags.
cadtopdm_control
Each auxiliary_files tag contains one or more cadtopdm_control tags. This tag indicates the
auxiliary files checkbox settings.
label This string contains the same text that appears next to the auxiliary file check boxes
on the Save dialog. For example, Save SolidWorks® Models or Save JT Files.
value A yes or no string which indicates whether the check box was enabled when the
user exit was called from the Save dialog.
configuration
Each configurations tag contains one or more configuration tags.
value The model name of a configuration, such as Default. The configuration need not be
represented by a row in the Save dialog.
configurations
A model tag that represents a part or assembly document will contain a configurations tag, which in turn
contains a configuration tag for each configuration within the document file.
file_name
Each model tag contains a file_name tag.
value This string contains the model’s file name, including its file name extension. For
example, part1.sldprt. For a configuration, the value of the file_name tag is
that of the configuration’s master document.
item_id
Each model tag contains an item_id tag.
value This string contains the model’s currently-assigned Item ID.
item_name
Each model tag contains an item_name tag.
value This string contains the mode’s currently-assigned Item Name
item_revision_id
Each model tag contains an item_revision_id tag.
value This string contains the model’s Item Revision ID.

6-3
Customization points

item_type
Each model tag contains an item_type tag.
value This string contains the model’s current Item Type.
model
A model tag is created for each row in the table of models. The following attributes are included in the model
tag:
first_save Possible values are yes and no. A value of yes indicates this is the first time this
model is being saved to Teamcenter.
can_rename Possible values are true and false. true indicates the model can be renamed,
so it is acceptable for the user exit to specify a new name. false indicates the
model cannot be renamed, the user exit should not try to rename it.
master This string contains the name of the master document. If this row is a document,
then master will be an empty string.
name The name of the model. For a document, this is the file name. For a configuration,
this is the configuration name.
save Possible values are yes and no. A value of yes indicates that the model has a
check in the save column.
selected Possible values are yes and no. A value of yes indicates that the model’s row in
the table was selected (highlighted) when the action was performed. This attribute is
not relevant for the saveValidation() user exit.
type This string indicates the model’s type. Possible values are sldasm, slddrw, and
sldprt.
properties
A model tag contains a properties tag, which in turn contains pdm_property tags for those model
attributes with Create Operation Descriptors in the Teamcenter schema definition.

pdm_property
The following attributes are included in the pdm_property tag:
name The name of the property.
required Possible values are yes and no. Yes indicates the property is required to complete
the save operation.
value This attribute contains the value of the property, as it would be displayed in the Save
dialog. If the property is an array, multiple value tags can be present and each will
have an index attribute such as index="0".

6-4
Customization points

Sample XML generated by the Integration

Figure 33 The save of a simple assembly referencing a new configuration in model 000032
This Save dialog contains an assembly 000031 that references three components 000029,
000030, and Blue<000032>. The Blue configuration has been added to part 000032, and has
not yet been saved to Teamcenter.
When the user presses the Replace button with the Blue configuration selected, the following
XML is generated:

6-5
Customization points

<?xml version="1.0" encoding="UTF-8"?>


<swim_user_exit action="replace" after_checkin_action="Retain Files" group="Engineering"
operation="Save" project="" role="Designer" user_id="jjd">
<auxiliary_files>
<cadtopdm_control label="Save SolidWorks Models" value="yes"/>
<cadtopdm_control label="Save JT Files" value="no"/>
</auxiliary_files>
<model first_save="no" master="" name="000029" save="no" selected="no" type="sldprt">
<item_type enabled="yes" mfk="no" value="Item"/>
<item_id enabled="yes" mfk="yes" value="000029"/>
<item_revision_id value="A"/>
<item_name enabled="no" mfk="no" value="drive shaft pin"/>
<file_name value="000029.sldprt"/>
<configurations>
<configuration value="Default"/>
</configurations>
<properties>
<pdm_property enabled="no" mfk="no" name="Item.uom_tag" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.object_desc" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.item_comment" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.previous_item_id
"required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.project_id" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.serial_number" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_1" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_2" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_3" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.object_desc"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.item_comment"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.previous_version_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.project_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.serial_number"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_1"
required="no">

6-6
Customization points

<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_2"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_3"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000031" save="yes" selected="no" type="sldasm">
<item_type enabled="yes" mfk="no" value="Item"/>
<item_id enabled="yes" mfk="yes" value="000031"/>
<item_revision_id value="A"/>
<item_name enabled="no" mfk="no" value="blade shaft"/>
<file_name value="000031.sldasm"/>
<configurations>
<configuration value="Default"/>
</configurations>
<child_models>
<child master="000032" name="Blue" type="sldprt"/>
<child name="000029" type="sldprt"/>
<child name="000030" type="sldprt"/>
</child_models>
<properties>
<pdm_property enabled="no" mfk="no" name="Item.uom_tag" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.object_desc" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.item_comment" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.previous_item_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.project_id" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.serial_number" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_1" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_2" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_3" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.object_desc"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.item_comment"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.previous_version_id"

6-7
Customization points

required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.project_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.serial_number"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_1"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_2"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_3"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000030" save="no" selected="no" type="sldprt">
<item_type enabled="yes" mfk="no" value="Item"/>
<item_id enabled="yes" mfk="yes" value="000030"/>
<item_revision_id value="A"/>
<item_name enabled="no" mfk="no" value="drive shaft"/>
<file_name value="000030.sldprt"/>
<configurations>
<configuration value="Default"/>
</configurations>
<properties>
<pdm_property enabled="no" mfk="no" name="Item.uom_tag" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.object_desc" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.item_comment" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.previous_item_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.project_id" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.serial_number" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_1" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_2" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_3" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.object_desc"

6-8
Customization points

required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.item_comment"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.previous_version_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.project_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.serial_number"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_1"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_2"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_3"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000032" save="yes" selected="no" type="sldprt">
<item_type enabled="yes" mfk="no" value="Item"/>
<item_id enabled="yes" mfk="yes" value="000032"/>
<item_revision_id value="A"/>
<item_name enabled="no" mfk="no" value="drive shaft plate"/>
<file_name value="000032.sldprt"/>
<configurations>
<configuration value="Default"/>
<configuration value="Blue"/>
<configuration value="Red"/>
<configuration value="White"/>
</configurations>
<properties>
<pdm_property enabled="no" mfk="no" name="Item.uom_tag" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.object_desc" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.item_comment" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.previous_item_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.project_id" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.serial_number" required="no">
<value/>

6-9
Customization points

</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_1" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_2" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Item Master.user_data_3" required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.object_desc"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.item_comment"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.previous_version_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.project_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.serial_number"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_1"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_2"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="ItemRevision Master.user_data_3"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="no" mfk="no" name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
<model first_save="yes" master="000032" name="Blue" save="yes" selected="yes" type="sldprt">
<item_type enabled="yes" mfk="no" value="Item"/>
<item_id enabled="yes" mfk="yes" value="Blue"/>
<item_revision_id value="A"/>
<item_name enabled="yes" mfk="no" value="Blue"/>
<file_name value="000032.sldprt"/>
<properties>
<pdm_property enabled="yes" mfk="no" name="Item.uom_tag" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.object_desc" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.item_comment" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.previous_item_id"
required="no">
<value/>
</pdm_property>

6-10
Customization points

<pdm_property enabled="yes" mfk="no" name="Item Master.project_id" required="no">


<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.serial_number" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.user_data_1" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.user_data_2" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Item Master.user_data_3" required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.object_desc"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.item_comment"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.previous_version_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.project_id"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.serial_number"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.user_data_1"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.user_data_2"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="ItemRevision Master.user_data_3"
required="no">
<value/>
</pdm_property>
<pdm_property enabled="yes" mfk="no" name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
</swim_user_exit>
<swim_user_exit action="replace" after_checkin_action="Retain Files"
group="Engineering" operation="Save" project=""
role="Designer" user_id="jmd">
<auxiliary_files>
<cadtopdm_control label="Save SolidWorks Models" value="yes"/>
</auxiliary_files>
<model first_save="no" master="" name="000087" save="no" selected="no"
type="sldprt">
<item_type value="Item"/>
<item_id value="000087"/>
<item_revision_id value="A"/>
<item_name value="drive shaft"/>
<file_name value="000087.sldprt"/>
<configurations>
<configuration value="Default"/>
</configurations>
<properties>

6-11
Customization points

<pdm_property name="Item.object_desc" required="no">


<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Dataset.object_desc" required="no">
<value>drive shaft</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000088" save="no" selected="no"
type="sldprt">
<item_type value="Item"/>
<item_id value="000088"/>
<item_revision_id value="A"/>
<item_name value="stainless drive shaft pin"/>
<file_name value="000088.sldprt"/>
<configurations>
<configuration value="Default"/>
</configurations>
<properties>
<pdm_property name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Dataset.object_desc" required="no">
<value>drive shaft pin</value>
</pdm_property>
</properties>
</model>
<model first_save="yes" master="000089" name="Blue" save="yes"
selected="no" type="sldprt">
<item_type value="Item"/>
<item_id value="Blue"/>
<item_revision_id value="A"/>
<item_name value="Blue"/>
<file_name value="000089.sldprt"/>
<properties>
<pdm_property name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Dataset.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000089" save="yes" selected="no"
type="sldprt">
<item_type value="Item"/>
<item_id value="000089"/>
<item_revision_id value="C"/>
<item_name value="drive shaft plate"/>
<file_name value="000089.sldprt"/>
<configurations>
<configuration value="Default"/>
<configuration value="Red"/>
<configuration value="White"/>
<configuration value="Blue"/>
</configurations>
<properties>
<pdm_property name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Dataset.object_desc" required="no">
<value>drive shaft plate</value>
</pdm_property>
</properties>
</model>
<model first_save="no" master="" name="000086" save="no" selected="yes"
type="sldasm">
<item_type value="Item"/>
<item_id value="000086"/>
<item_revision_id value="B"/>

6-12
Customization points

<item_name value="blade shaft"/>


<file_name value="000086.sldasm"/>
<configurations>
<configuration value="Default"/>
</configurations>
<child_models>
<child name="000087" type="sldprt"/>
<child name="000088" type="sldprt"/>
<child master="000089" name="Blue" type="sldprt"/>
</child_models>
<properties>
<pdm_property name="Item.object_desc" required="no">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Dataset.object_desc" required="no">
<value>blade shaft</value>
</pdm_property>
</properties>
</model>
</swim_user_exit>

Response XML from custom code


The saveInit(), saveItemId() saveNew() and saveReplace() user exits must provide a response in the form of
XML file written to the user’s %TEMP% directory. This response is read by the integration and applied to the
models in the Save dialog. Both user exits can generate new Item IDs and rename the models in
SolidWorks®. The XML definition requires a new Item ID, and optionally a new name, for the models. The
models need not have been selected, but they must have appeared in a model tag in the Integration-generated
XML.

Response Tags

save_operation_response
This is the root tag for the response. Only one save_operation_response tag will exist in the XML file. All
other tags are nested in the save_operation_response tag. The following are the attributes of the
save_operation_response tag.
action
This string specifies the action being performed within the operation. Possible values are new, replace, and
validate.
model
The save_operation_response contains one or more model tags. A model tag is created for each model
to be modified from the response XML. The model tag’s master, name, and type attributes must match
those of a model tag in the Integration-generated XML. The new_item_id and new_model_name attributes
contain the modified values to apply to corresponding rows in the Save dialog. The following attributes are
included in the tag:

6-13
Customization points

master A string containing the name of the master document. If the model is itself a
document, then master will be an empty string.
name The name of the model to be processed. For a document, this is the file name. For
a configuration, this is the configuration name.
new_item_id The value must be that of a new Item Id. This is a required attribute. It is not
permitted to change the model name only. The integration will not attempt to
determine whether the Item ID already exists. The user exit must perform any
validation that is required.
new_model_name The new name for the model (optional)
type The type of the model, such as sldasm, slddrw, or sldprt.

properties
A model tag contains a properties tag, which in turn contains pdm_property tags for those model
attributes with Operation Descriptors in the Teamcenter schema definition. All properties provided in the
integration generated XML must be in the response XML file. The pdm_property tag is the means to change
Multi-Field properties. Item Type can be a Multi-Field key, but it cannot be changed through one of the user
exits.

pdm_property
The following attributes are included in the pdm_property tag:
name The name of the property as provided in the integration generated XML file.
Additionally, Item Name and the Item Revision ID can be changed by adding
pdm_property tag with name="Item.object.name" for Item Name and tag with
name="ItemRevision.item_revision_id" for Item Revision Id.
value This attribute contains the value of the property, as it is to be displayed in the Save
dialog. If the value is empty, the property will be cleared. If the property is an array,
multiple value tags can be present and each will have an index attribute such as
index="0".

Sample Response XML


The following response XML will replace the Blue<000032> configuration with 000032_Blue<000032>:
<?xml version="1.0" encoding="UTF-8"?>
<save_operation_response action="replace">
<model master="000032" name="Blue" new_item_id="000032_Blue"
new_model_name="000032_Blue" type="sldprt">
<properties>
<pdm_property name="Item.uom_tag">
<value/>
</pdm_property>
<pdm_property name="Item.object_desc">
<value>From SolidWorks</value>
</pdm_property>
<pdm_property name="Item Master.object_desc">

6-14
Customization points

<value/>
</pdm_property>
<pdm_property name="Item Master.item_comment">
<value/>
</pdm_property>
<pdm_property name="Item Master.previous_item_id">
<value/>
</pdm_property>
<pdm_property name="Item Master.project_id">
<value/>
</pdm_property>
<pdm_property name="Item Master.serial_number">
<value/>
</pdm_property>
<pdm_property name="Item Master.user_data_1">
<value>Replace Master 33</value>
</pdm_property>
<pdm_property name="Item Master.user_data_2">
<value/>
</pdm_property>
<pdm_property name="Item Master.user_data_3"/>
<pdm_property name="ItemRevision Master.object_desc">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.item_comment">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.previous_version_id">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.project_id">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.serial_number">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.user_data_1">
<value>Replace Master 33</value>
</pdm_property>
<pdm_property name="ItemRevision Master.user_data_2">
<value/>
</pdm_property>
<pdm_property name="ItemRevision Master.user_data_3">
<value/>
</pdm_property>
<pdm_property name="Dataset.object_desc">
<value>From SolidWorks</value>
</pdm_property>
</properties>
</model>
</save_operation_response>

6-15
Customization points

Siemens Industry Software


Headquarters Europe
Granite Park One Stephenson House
5800 Granite Parkway Sir William Siemens Square
Suite 600 Frimley, Camberley
Plano, TX 75024 Surrey, GU16 8QD
USA +44 (0) 1276 413200
+1 972 987 3000
Asia-Pacific
Americas Suites 4301-4302, 43/F
Granite Park One AIA Kowloon Tower, Landmark East
5800 Granite Parkway 100 How Ming Street
Suite 600 Kwun Tong, Kowloon
Plano, TX 75024 Hong Kong
USA +852 2230 3308
+1 314 264 8499

About Siemens PLM Software


Siemens PLM Software, a business unit of the Siemens © 2014 Siemens Product Lifecycle Management
Industry Automation Division, is a leading global provider of Software Inc. Siemens and the Siemens logo are
product lifecycle management (PLM) software and services registered trademarks of Siemens AG. D-Cubed,
with 7 million licensed seats and 71,000 customers Femap, Geolus, GO PLM, I-deas, Insight, JT, NX,
worldwide. Headquartered in Plano, Texas, Siemens PLM Parasolid, Solid Edge, Teamcenter, Tecnomatix and
Software works collaboratively with companies to deliver Velocity Series are trademarks or registered
open solutions that help them turn more ideas into trademarks of Siemens Product Lifecycle
successful products. For more information on Siemens PLM Management Software Inc. or its subsidiaries in the
Software products and services, visit United States and in other countries. All other
www.siemens.com/plm. trademarks, registered trademarks or service marks
belong to their respective holders.

6-16

You might also like