Вы находитесь на странице: 1из 29

Altair HyperWorks 2019

HyperWorks Collaboration Tools Tutorials

altairhyperworks.com
Intellectual Property Rights Notice
Copyrights, Trademarks, Trade Secrets, Patents & Third Party Software Licenses

Altair HyperWorks 2019 Copyright 1986-2019

The Platform for Innovation™

Altair Engineering Inc. Copyright © 1986-2019. All Rights Reserved.


Note: Pre-release versions of Altair software are provided ‘as is’, without warranty of any kind.
Usage of pre-release versions is strictly limited to non-production purposes.

Altair HyperWorks™ - The Platform for Innovation™


Altair AcuConsole™ ©2006-2019

Altair AcuSolve™ ©1997-2019

Altair ElectroFlo™ ©1992-2019

Altair ESAComp™ ©1992-2019

Altair Feko™ ©1999-2014 Altair Development S.A. (Pty) Ltd.; ©2014-2019 Altair Engineering
Inc.

Altair Flux™ ©1983-2019

Altair FluxMotor™ ©2017-2019

Altair HyperCrash™ ©2001-2019

Altair HyperGraph™ ©1995-2019

Altair HyperLife™ ©1990-2019

Altair HyperMesh™ ©1990-2019

Altair HyperStudy™ ©1999-2019

Altair HyperView™ ©1999-2019

Altair Virtual Wind Tunnel™ ©2012-2019

Altair HyperXtrude™ ©1999-2019


Altair MotionSolve™ ©2002-2019

Altair MotionView™ ©1993-2019

Altair Multiscale Designer™ ©2011-2019

Altair OptiStruct™ ©1996-2019

Altair Radioss™ ©1986-2019

Altair SimLab™ ©2004-2019

Altair SimSolid™ ©2015-2019

Altair nanoFluidX™ ©2013-2018 Fluidyna GmbH, © 2018-2019 Altair Engineering Inc.

Altair ultraFluidX™ ©2010-2018 Fluidyna GmbH, © 2018-2019 Altair Engineering Inc.

Altair WinProp™ ©2000-2019;

Altair ConnectMe™ ©2014-2019;

Plus other products from the Altair solidThinking Platform.

Altair Packaged Solution Offerings (PSOs)


Altair Automated Reporting Director™ ©2008-2019

Altair GeoMechanics Director™ ©2011-2019

Altair Impact Simulation Director™ ©2010-2019

Altair Model Mesher Director™ ©2010-2019

Altair NVH Director™ ©2010-2019

Altair Squeak and Rattle Director™ ©2012-2019

Altair Virtual Gauge Director™ ©2012-2019

Altair Weight Analytics™ ©2013-2019

Altair Weld Certification Director™ ©2014-2019

Altair Multi-Disciplinary Optimization Director™ ©2012-2019


Altair solidThinking - Where Innovation Begins™
Altair Inspire™ ©2009-2019 including Altair Inspire Motion and Altair Inspire Structures

Altair Inspire™ Extrude-Metal ©1996-2019 (formerly Click2Extrude®-Metal)

Altair Inspire™ Extrude-Polymer ©1996-2019 (formerly Click2Extrude®-Polymer)

Altair Inspire™ Cast ©2011-2019 (formerly Click2Cast®)

Altair Inspire™ Form ©1998-2019 (formerly Click2Form®)

Altair Inspire™ Mold ©2009-2019 (initial release-Q2 2019)

Altair Inspire™ Studio ©1993-2019 (formerly ‘Evolve’)

Altair Compose™ ©2007-2019 (formerly solidThinking Compose®)

Altair Activate™ ©1989-2019 (formerly solidThinking Activate®)

Altair Embed™ ©1989-2019 (formerly solidThinking Embed®)

• Altair Embed SE™ ©1989-2019 (formerly solidThinking Embed® SE)


• Altair Embed/Digital Power Designer ©2012-2019

Altair SimLab™ ©2004-2019

Altair 365™ ©1994-2019

Altair PBSWorks™ - Accelerating Innovation in the


Cloud™
Altair PBS Professional™ ©1994-2019

Altair Control™ ©2008-2019; (formerly PBS Control)

Altair Access™ ©2008-2019; (formerly PBS Access)

Altair Accelerator™ ©1995-2019; (formerly NetworkComputer)

Altair Accelerator Plus™©1995-2019; (formerly WorkloadXelerator)

Altair FlowTracer™ ©1995-2019; (formerly FlowTracer)

Altair Allocator™ ©1995-2019; (formerly LicenseAllocator)


Altair Monitor™ ©1995-2019; (formerly LicenseMonitor)

Altair Hero™ ©1995-2019; (formerly HERO)

Altair Software Asset Optimization™ (SAO) ©2007-2019

Note:

Compute Manager™ ©2012-2017 is now part of Altair Access

Display Manager™ ©2013-2017 is now part of Altair Access

PBS Application Services™ ©2008-2017 is now part of Altair Access

PBS Analytics™ ©2008-2017 is now part of Altair Control

PBS Desktop™ ©2008-2012 is now part of Altair Access, specifically Altair Access desktop,
which also has Altair Access web and Altair Access mobile

e-Compute™ ©2000-2010 was replaced by “Compute Manager” which is now Altair Access

Altair SmartWorks™ - Innovation Intelligence®


Altair SmartCore™ ©2011-2019

Altair SmartEdge™ ©2010-2019

Altair SmartSight™ ©2014-2019

Altair intellectual property rights are protected under U.S. and international laws and treaties.
Additionally, Altair software is protected under patent #6,859,792 and other patents pending. All
other marks are the property of their respective owners.

ALTAIR ENGINEERING INC. Proprietary and Confidential. Contains Trade Secret


Information.

Not for use or disclosure outside of Altair and its licensed clients. Information contained in Altair
software shall not be decompiled, disassembled, “unlocked”, reverse translated, reverse
engineered, or publicly displayed or publicly performed in any manner. Usage of the software is
only as explicitly permitted in the end user software license agreement. Copyright notice does
not imply publication.

Third party software licenses


AcuConsole contains material licensed from Intelligent Light (www.ilight.com) and used by
permission.

Software Security Measures:

Altair Engineering Inc. and its subsidiaries and affiliates reserve the right to embed software
security mechanisms in the Software for the purpose of detecting the installation and/or use of
illegal copies of the Software. The Software may collect and transmit non-proprietary data about
those illegal copies. Data collected will not include any customer data created by or used in
connection with the Software and will not be provided to any third party, except as may be
required by law or legal process or to enforce our rights with respect to the use of any illegal
copies of the Software. By using the Software, each user consents to such detection and
collection of data, as well as its transmission and use if an illegal copy of the Software is
detected. No steps may be taken to avoid or detect the purpose of any such security mechanisms.
Technical Support
Altair provides comprehensive software support via web FAQs, tutorials, training classes,
telephone and e-mail.

Altair Support on the World Wide Web


The Altair web site is a valuable online companion to Altair software. Visit
www.altairhyperworks.com for tips and tricks, training course schedules, training/tutorial videos,
and other useful information.

Altair Training Classes


Altair training courses provide a hands-on introduction to our products, focusing on overall
functionality. Courses are conducted at our main and regional offices or at your facility. If you
are interested in training at your facility, please contact your account manager for more details. If
you do not know who your account manager is, please send an e-mail to training@altair.com and
your account manager will contact you.

Telephone and E-mail


When contacting Altair support, please specify the product and version number you are using
along with a detailed description of the problem. Many times, it is very beneficial for the support
engineer to know what type of workstation, operating system, RAM, and graphics board you
have, so please have that information ready. If you send an e-mail, please specify the workstation
type, operating system, RAM, and graphics board information in the e-mail.

To contact an Altair support representative, reference the following table or the information
available on the HyperWorks website:
www.altairhyperworks.com/ClientCenterHWSupportProduct.aspx.
Location Telephone E-mail
Australia 64.9.413.7981 anzsupport@altair.com
Brazil 55.11.3884.0414 br_support@altair.com
Canada 416.447.6463 support@altairengineering.ca
China 86.400.619.6186 support@altair.com.cn
France 33.1.4133.0992 francesupport@altair.com
Germany 49.7031.6208.22 hwsupport@altair.de
91.80.6629.4500
India support@india.altair.com
1.800.425.0234 (toll free)
Location Telephone E-mail
Israel israelsupport@altair.com
Italy 39.800.905.595 support@altairengineering.it
Japan 81.3.6225.5830 support@altairjp.co.jp
Malaysia aseansupport@altair.com
Mexico 55.56.58.68.08 mx-support@altair.com
South Africa 27 21 8311500 support@altair.co.za
South Korea 82.70.4050.9200 support@altair.co.kr
Spain 34 910 810 080 support-spain@altair.com
Sweden 46.46.460.2828 support@altair.se
United Kingdom 01926.468.600 support@uk.altair.com
United States 248.614.2425 hwsupport@altair.com

For questions or comments about this help system, send an email to connect@altair.com.

In addition, the following countries have resellers for Altair Engineering: Colombia, Czech
Republic, Ecuador, Israel, Russia, Netherlands, Turkey, Poland, Singapore, Vietnam, Indonesia

Official offices with resellers: Canada, China, France, Germany, India, Malaysia, Italy, Japan,
Korea, Spain, Taiwan, United Kingdom, USA

See www.altair.com for complete contact information.


Accessing the Model Files

Required model files of the models you build in the tutorials are available online.
1. To access model files, visit the Altair Client Center or Altair Connect.

A user ID and password are required to access the model files. Follow the instructions at the
website to obtain login credentials.

2. Select the required file package and download it onto your system.
Note that the files may require unzipping before proceeding with the tutorials. When extracting
zipped files, preserve any directory structure included in the file package.
HWCT-1300: Managed Libraries

In this tutorial, you will learn to:


• Create a new library in the personal repository.
• Create and manage workspaces in a managed library.
• Use the Organize browser to organize and explore categories and folders.
The model file used in this exercise is located in the hwe.zip file in the Altair HyperWorks Enterprise
directory. Copy the file(s) from this directory to your working directory.

Step 1: Create a new managed library and workspace


1. Create locations to store your new library and workspace:

C:\MyLibraries

C:\MyLibraries\Workspaces
2. Launch Altair HyperWorks.

3. Click View > Browsers > HyperWorks > Organize to open the Organize browser.

4. Select Personal from the Repository list.

5. Select the Library drop-down and click New.

6. Provide the following information:

Name: Occupant Safety Library

Location: Browse to and select C:/MyLibraries

Type: CAE

7. Select the drop-down next to Workspace and click New.

8. Provide the following information:

Name: Airbag Project


Working Directory: Browse to and select C:/MyLibraries/Workspaces

9. Click OK.

10. Click OK. A new CAE library, Occupant Safety Library is created, along with a new associated
workspace, Airbag Project.

Step 2: Create categories


1. Select the drop-down on the Category Mode/Folder Mode toolbar icon and select Category
Mode .
2. Click the drop-down next to the New Content icon, , and select Category, .

3. Provide the following information:

Name: Airbag Project

Description: Airbag Project files


4. Click Save.

5. Repeat Steps 1-3 to create a second category. Provide the following information for the second
category:

Name: Results

Description: Results files

6. Click in the Value column of the Category row.

7. Click the browse folder.

8. Check Airbag Project, then click OK.

9. Click Save. The Results Category is created within the Airbag Project category.

10. Right-click the Airbag Project category and select New > Category.

11. Provide the following information for the second category:

Name: Reports

Description: Report files

Category: Airbag Project

12. Click Save.

Step 3: Create folders


1. Select the drop-down on the Category Mode/Folder Mode icon and select Folder Mode .

2. Click the drop-down next to the New Content icon, , and select Folder, .

3. Provide the following information:

Name: Airbag Project

Description: Project files


4. Click Save.
5. Right-click the AirbagProject folder and select New > Folder.

6. Provide the following information:

Name: DriverRun
Description: driver simulation files

Notice that the parent folder is AirbagProject.

7. Click Save.
Step 4: Populate the library
1. Right-click the DriverRun folder and select New > Result File. Notice that the folder has been
set in the New Result File dialog.

2. Click in the Value column of the Category row, click the browse folder, , check Results, and
click OK.
3. Click in the Value column of the Documents row, click the browse folder, and select the
driv_bag.KIN3 file that you downloaded from AirbagProject\DriverRun from the hwe.zip
directory.

4. Click Open. Notice that the file is parsed and metadata is extracted in filled in automatically.
5. Click Save. The content is added to the library.
You could continue to manually add contents one at a time to the library. Instead, you will add
some additional contents in bulk.

6. Right-click the root library folder, , and select Add Folder.

7. In the Select Files/Folders dialog, click the Add Folder icon .

8. Navigate to and select the directory AirbagProject.

9. Click OK.
10. Click OK in the notification dialog. Wait for the indexing process to complete (it should take just a
few seconds, depending on your client.)

11. When notified that the indexing is complete, click Yes to refresh the Organize browser. The
contents have been added to the library. Shown in Folder Mode:

Notice the icon next to DrivePassReport.mvw indicating that it refers to other contents in the
library.

12. Click the Show/Hide References icon to show the references, which were automatically created
when the contents were added in bulk.

13. Select the drop down on the Category Mode/Folder Mode icon and select Category Mode, .
View the library contents in Category Mode, as shown below.
Category assignments do not get created automatically when bulk adding contents.
14. Right-click pass_bag.KIN3 and select Check-Out.

15. Right-click pass_bag.KIN3 and select Advanced Edit. The Advanced Edit dialog displays.

16. Click in the Value column of the Category row, click the browse folder, , check Results, and
click OK.

17. Click Check-In. The content moves to the Results category.

18. Repeat steps 15-18 and move DrivePassReport.mvw to the Reports category.

Summary
In this tutorial you worked with the Organize browser to add a new library to the out-of-the-box
Personal repository. Both a virtual category structure as well as a physical folder structure were
created to organize the contents of the library. Subsequently, this library was populated, and
automatic metadata extraction and reference creation was seen, allowing for information capture with
no additional effort from you.
HWCT-1400: Managed Libraries

In this tutorial, you will learn to:

• Add an existing library to the personal repository.


• Work with contents in a managed library.
• Become familiar with versioning and life cycle operations.

Step 1: Retrieve library


1. Create locations to store the library and workspaces:
C:\MyLibraries

C:\MyLibraries\Workspaces

2. Unzip SimulationProjects.zip from the Altair HyperWorks Enterprise hwe.zip directory to your
library directory, C:\MyLibraries.

Step 2: Add a managed library


1. Launch Altair HyperMesh.
2. Click View > Organize to open the Organize browser.

3. Select Personal from the Repository list.

4. Select the Library drop-down and click Add.

5. Click the Folder browser next to File Name, browse to, and select C:\MyLibraries\Simulation
Projects\Simulation Projects.ldb.

6. Click Open.

7. Click OK. The Simulation Projects is added to the Personal repository.

Step 3: Create workspaces


1. Click the drop-down arrow next to Workspace and select New.
2. Provide the following information:

Name: Workspace 1

Working Directory: Browse to and select C:\MyLibraries\Workspaces

3. Click OK in the Browse for Folder dialog.

4. Click OK in the New Workspace dialog.


5. Repeat Steps 1-4 to create a second workspace called Workspace 2 in
C:\MyLibraries\Workspaces.
Step 4: Browse, search and retrieve contents
Now you will look at the contents of the Simulation Projects library.

1. Begin by viewing the contents in the Repository View, Category Mode (above). The library
contains two different master solver deck files, Plane.fem and master.k, each of which has three
include solver deck files. The contents are organized by different categories: Aero, Parts,
Assembled Models, and so on.

2. Switch the Category/Folder Mode toggle to Folder Mode, . Now you can see the folder
organization of the same contents. The contents are organized both within virtual categories, as
well as physical folders.

Note: The contents may belong to multiple categories, however, files


may exist in only a single folder.

3. Click the Show/Hide References icon to view the references. Now you can see, for example,
that Plane.fem refers to its include files.
With the references defined, all life cycle operations (Get, Check Out, Check In) will be handled
for the set of referenced contents.

4. Click the drop-down arrow next to Workspace and select Workspace 1.


5. Click OK. Workspace 1 is now the active workspace.

6. Click Plane.fem. You can view the content’s properties in the Property panel.

Note: The Property panel can be toggled on or off by clicking the


icon.

Notice that the document Plane.fem is not retrieved. You can select any of the referenced files
and notice that they are also not retrieved. Because this is a managed repository, the files are
stored in the managed vault. To view or edit files associated with contents, the files must be
retrieved to your workspace.

7. Right-click Plane.fem and select Get from the context menu. Notice that Plane.fem, along with
its referenced include files, has been retrieved to Workspace 1.

8. Select Repository/Workspace, , and switch between Repository view, , and


Workspace view, , to view contents in both locations.

Repository view Workspace view

Note: The above views are shown in Folder Mode. They can be
viewed in Category Mode as well.

9. Right-click Plane.fem and select Import FE Model. The HyperMesh Import tab displays, with
the path to Plane.fem loaded.

Note: The list of Altair HyperWorks integration options will change


based on the type of file selected and the active client (Altair
HyperMesh or Altair HyperWorks Desktop active client.) Because
plane.fem is a solver deck, you will see the Import FE Model
option.

10. Click Import. The plane model, master and includes, are loaded into Altair HyperMesh.

Step 5: Version contents


1. Click Mesh > Delete > Elements > Delete Model to delete the model in Altair HyperMesh so
there is nothing in the current Altair HyperMesh session.

2. In the Organize tab, select the drop-down next to Workspace and select Workspace 2 to set it
as the active workspace. There are no contents in the Workspace view because nothing has been
retrieved to this workspace.

3. From the Repository View, right-click Fuselage.fem and select Check-Out. The file is retrieved
to Workspace 2, and the content is marked as checked out.

4. Right-click Fuselage.fem and select Import FE Model.


5. Click Import. The model is imported into Altair HyperMesh.
Now, you will make a change to the model and check it back in. The change will be simple, but
obvious, so that the changes will be easily seen.

6. Select Mesh>Delete>Elements to open the Delete panel.


7. From the drop-down switch from elems to comps.

8. Click comps, check component FlSK, click select, click delete entity, click return. The
component is deleted.

9. Select File>Export>Solver Deck.

• File type: OptiStruct


• Template: Standard format
10. Click the File browser and browse to Fuselage.fem in the Workspace 2 location where the
checked out solver deck resides:
C:\MyLibraries\Workspaces\Workspace2\Simulation_Projects\AeroProject\includes. Note
the full path, including sub folders. You should see the checked out solver deck file, the one being
modified, already in this location. You will overwrite that file with your modified file.

11. Click Save.

12. Click Yes to replace the old Fuselage.fem file.

13. Click Export.

14. Click Yes to overwrite.


15. In the Organize tab, right-click the checked out Fuselage.fem and select Check-in.

16. Enter some comments in the Check-In Dialog.

17. Click OK. Version 2 of Fuselage.fem is checked in.

Step 6: View version history and synchronize


1. Set Workspace 1 as the active workspace. Notice that Plane.fem is flagged to indicate that it is
out of sync. This is because Plane.fem in Workspace 1 is referring to Fuselage.fem version 1,
which is no longer the up to date version. This is also indicated on the Fuselage.fem content being
referenced by Plane.fem.

Note: Click the icon to view references in the browser.

2. Right-click Fuselage.fem and select Version History. The Version History panel displays.
3. Click either version of Fuselage.fem to view its properties in the Properties panel.

4. Click either version of Fuselage.fem, hold the CONTROL key, and click the other version so that
both versions are selected.
5. Right-click and select Compare Properties. The two versions’ properties are displayed side by
side with differences highlighted in red.

Note: It is also possible to compare the file contents themselves. Try


setting a default diff program in the Collaboration Tools
Preferences (right-click and select Set Preferences from the
Organize browser context menu). Next, select the two versions
of Fuselage.fem, right-click, and select Compare Docs
Versions.

6. Click the Back to Standard View icon to return to the Organize tab standard view.

7. Right-click Plane.fem, and select Synchronize. Version 2 of Plane.fem is created, using the up
to date version 2 of Fuselage.fem.

8. Click Yes to All to retrieve the updated plane and references to Workspace 1.
9. Right-click Plane.fem and select Import FE Model. The HyperMesh Import tab displays, with
the path to Plane.fem loaded.

10. Click Import. The plane model, master and includes, are loaded into Altair HyperMesh. Notice that
version 2 of the plane contains the latest version of the fuselage, with the skin component deleted.

Summary
In this tutorial you worked with the Organize browser to add an existing managed library to your
Personal repository. You explored the contents of the library, and retrieved contents which were then
loaded in Altair HyperMesh via the Collaboration Tools – Altair HyperMesh integration. You became
familiar with life cycle operations by checking out, modifying, and checking in a content and creating a
new version. You used the Version History panel to compare versions. And, finally, you synchronized
contents to work with the latest up-to-date information from the repository.
HWCT-1500: Profiles

HyperWorks Collaboration Tools profiles are a collection of content types, parsers and customizations
using HyperWorks Collaboration Tools APIs and tcl/tk scripting. In this tutorial, you will learn how to
create a Profile for managing Microsoft Office documents within a HyperWorks Collaboration Tools
library.
Background Information
Content definitions
Content definitions encapsulate information about the types of data and information managed by
HyperWorks Collaboration Tools and viewable within the Organize browser. This information includes:

• Metadata associated with the content


• Dependencies between the metadata
• Relationships that can be created between the content type and others
Any type of information or file can be managed by HyperWorks Collaboration Tools, provided it can be
described using the appropriate content definition format.

Content definition xml schema

Content definitions are created using simple .xml files, conforming to the HyperWorks XML Schema.
Note that HyperWorks Collaboration Tools does not have a schema validating XML parser; hence, it is
the responsibility of the publisher to make sure the content type XML description is validated
externally.

• At the root of the document is the element ContentType, with name as a mandatory attribute.
It contains a list of metadata.
• Each metadata has name and type as required attributes. There are many other attributes,
listed below, and best seen by example.
• If the “mandatory” attribute is true, then this attribute must have a value when the content is
published to the library. In this case, it is good practice to specify a “defaultvalue”.
• Metadata may have a set of valid values.
Metadata attributes
• name (mandatory - string): name of metadata.
• type (mandatory - string): metadata value type. Should be one of string, int, float, boolean.
• dname (boolean): if it is true then the metadata is used as name for the related content.

Note: dname can only be true for one metadata per content definition.

• editable (boolean): if it is true then the metadata is editable.


• displayable (boolean): if it is true then the metadata is displayed.
• mandatory (boolean): if it is true then the metadata is required to be filled by you when
creating content.
• displayName (string): metadata display name.
• defaultvalue (string): metadata default value.
• category (string): metadata category.
Parser
A parser automatically extracts information from files when they are added to a library. The extracted
information is stored as content metadata, or as indexed metadata, and can be used when searching
for contents in the Organize browser. Searches can be metadata-based or full-text based.

Step 1: Update the librarypreferences.xml file


A typical profile consists of the following:

• Install.tcl  To install the profile


• libraryprofiles.xml  Contains path to Content definitions, parsers and custom integration .tcl
files.
• Main folder  Contains custom scripts, content definition .xml files and parser .tcl files.

1. Copy this start package zip file (OfficeProfile_Raw.zip) from the Altair HyperWorks Enterprise
hwe.zip directory and extract it to a convenient location, for example C: /OfficeProfiles/. The
start package contains a generic install .tcl file that does not need any editing. Now you will take
a look at the libraryprofiles.xml file. The image below shows a typical libraryprofile.xml
file.

Edit the following information:

2. To change the profile name edit the line, as shown below:

3. Edit the path to content definition, as shown below:

4. Edit the custom integration information, as shown below. This information will be used by the core
to point to appropriate tcl procedures which are used to perform custom operations in the
Organize browser.

5. Edit the path to the parser.xml file, which points to parser tcl files. You will look into parser.xml
in the following steps.

6. Edit the path to the preferences file as shown below:

7. Save your updated librarypreferences.xml file.


Step 2: Create content definition for office documents
Now you will create content definition for office documents. The folder \Profile_Main\ContentDefinitions
contains all the content definition files of a profile. Since you are creating only one content definition
for this profile the start package has only one content .xml file. A profile can have multiple content
definitions.

1. Rename the .xml file under Profile_Main\ContentDefintitions to OfficeDocument.xml.

2. Open the OfficeDocument.xml file in a text editor, change the file types and save. This informs
the core that this content type has three types of files, Word, Excel and PowerPoint.

Now take a look at the parser.xml which points to parser code in tcl.

3. Open the \Profiles_Main\parser.xml in a text editor and edit the information, as shown below.
The module informs the core which tcl package to use and the namespace is to inform the core
which tcl namespace to use to parse the data.

Step 3: Parser TCL code


In the previous step you edited the parser.xml file to point to the appropriate tcl code. Now you will
take a look at the parser tcl code. For simplicity the start package code does not need any editing.

1. Open \Profiles_Main\OfficeParser1.0\OfficeFileParser.tcl in a text editor.

Procedure ::custom::integration::office::officeFileParser::impl_canParse informs the


core whether a file can be parsed. You can add your own logic to decide if the file can be parsed.
A return value of 0 informs the core that the file cannot be parsed. Under such a situation the file
will be added as a general file in the library.
A return value of 1 informs the core that this file can be parsed. In the code below you will check
for the file extensions and if they are .docx, .pptx or .xlsx then set the return as 1. Otherwise it
will return 0.

Procedure ::custom::integration::office::officeFileParser::impl_Parse parses the


information and sets the parsed information as metadata on the content being added to the
library. In the code below the display name is set as the file name by using the API
ParsedDocument_addMetadata. For more information, refer to the HyperWorks Collaboration Tools
API documentation.
Step 4: Customize the Organize browser
Now you will work on the customization of the Organize browser. Via profiles you can add your own
custom context menus, toolbar icons and also have custom procedures which will be run before or
after a lifecycle operation. For example, if you want to display a message saying "Check in successful"
after a content is checked in you could add this message as part of the post check-in call. Refer to the
HyperWorks Collaboration Tools Profiles documentation for more details.
In this exercise you will edit an existing context menu procedure to show a message when it is clicked
from the Organize browser.

1. Open the file Profiles_Main\OfficeIntegration1.0\officeIntegration.tcl in a text editor.

2. Search for procedure ::custom::integration::office::CtxMenuAddCustomItems. The core will


look at this procedure to add the custom context menus.

3. Add command -command "::custom::integration::office::ShowMessage $obj as shown below:

Note that you are calling another procedure ::custom::integration::office::ShowMessage as


an action after the custom context menu is clicked. Copy the code below in the
officeIntegration.tcl file. It does not matter where the lines below are pasted in the .tcl file.
Step 5: Install a profile
1. To install a profile run C:\OfficeProfile\install.tcl in HyperWorks Desktop session. Once the
installation is complete, an Installation Complete message is displayed in the tcl command window.
Restart the Altair HyperWorks session after the Profile installation is complete.

Step 6: Create a new library using the office profile


1. From the Organize browser select the Repository type Personal.
2. Select the combo box from the Library and select New Library. A New Library dialog displays.
Enter the Name and select the path where you want to create the library.
3. Click the Profile field to see the list installed and select Office Profile. Leave the Workspace as
the default.
4. Click OK to create a new library.

Step 7: Add a new content to the office library


In the previous step you created a new library using the Office profile. Now you will add a PowerPoint
document to this library.
1. Select OfficeDocument from the New Content toolbar. A New Office Document dialog
displays.

2. Click in the Value area of the Documents row, click the File Browser and browse to and select
an Office file.
3. Click Open. Note that the File Name is automatically populated.
4. From the File Type row select the appropriate file type.

Note: As an enhancement to the previously created parser, you could


update the parser to set this value automatically.

5. Click Save to add the PowerPoint file to the library.


Step 8: View the custom context menu
Now you will review the action of adding a new custom context menu.

1. Select the PowerPointFile content you added to the library earlier.


2. Right-click the above selection to view the context menus. Note that the custom menu appears on
the top of a list of available context menus.
3. Select the custom context menu to display the filename. Click OK to return to the Organize
browser.

Summary
In this tutorial you:
• Created a new profile
• Added a new content definition
• Added a new parser
• Customized the context menu to display the file name
HyperWorks Collaboration Tools profiles can be used to do so much more. Refer to the HyperWorks
Collaboration Tools Profiles and API documentation for more information.

Вам также может понравиться