Document Structure XML Tags for HSF

 

Proposed By: Tech Soft 3D
Contributors: SolidWorks, Spatial, ITI, COADE
Initial Release Date: October 17th, 2002
Acceptance Date: December 5th, 2002
Last Modification: December 5th, 2002

 

Introduction

The document structure information within a HSF is additional data that a user may decide to store within a HSF to complement the visual data within the file. By storing it, users of the data will have a much better understanding of the visual data within the file. This specific extension is primarily designed for users of HSF within the CAD Community. The XML tags are designed to be self-contained and uses the segment hierarchy within the defined within the HSF to provide a mapping layer between the document structure information and the visual data in the file.

This initial design only considers assemblies, parts and drawings. In a subsequent release we may expand the specification to support finer grain Product Structure information such as support for faces, edges and vertices.

This data should be stored as one complete XML tag within the HSF.


XML Tags

<DocumentStructure>

Parameters:

           Name = string; this is an optional parameter

 

This is the outer most tag and must be the opening and closing tag in the Document Structure XML tags.  Name is an optional argument.

 

The Product Structure tag can contain <Document> and/or <Library> tags.

 

<Library>

No Parameters

 

This is the tag for holding all parts and/or assemblies which may be instanced within the document.  It can contain either <Part> and/or <Assembly> tags.

 

Note, a <Part> or <Assembly> that is contained in a Library can only contain a InstanceLocation attribute field if it’s part of an assembly. Also, an object does not need to reside within the library to be instanced.

 

<Document>

Parameters:

            Name = string, this is an optional parameter

            Type = string, this is a mandatory parameter

 

Type can have one of three values ‘part’, ‘assembly’ or ‘drawing’.  The type value dictates which tags can be further defined in the XML data.  A part can only contain <Part> tags, an Assembly can contain <Part> and/or <Assembly> tags while a drawing can only contain <Sheet> and/or <View> tags.

 

<Assembly>

Parameters

            Name:                         string, this is optional

           Location:                      string, required parameter

           InstanceLocation:         string, this a required parameter if the Assembly is an instance.

 

The Location is a comma separated list of paths to the root of the segment trees within the HSF containing the entities which represent the Assembly.  The InstanceLocation is similar except it is to the roots of the segment trees defining the instance.

 

 

An Assembly tag can contain <Assembly> and/or <Part> tags.

 

<Part>

Parameters

            Name:                         string, this is optional

            Location:                     string, required parameter

            InstanceLocation:        string, this a required parameter if the Part is an instance.

 

The Location is a comma separated list of the paths to the root of the segment trees in the HSF containing the entities which represent the Part.  The InstanceLocation is similar except it is to the root of the segment trees defining the instance. This InstanceLocation will already be referenced within the Library tag and its existence can be used to determine whether or not the assembly is an instance.

 

Currently, the <Part> tag can not contain any other tags.

 

<Sheet>

Parameters

            Name:                         string, this is optional

            Location:                     string, required parameter

 

A sheet is only a valid tag if the Document is of type ‘drawing’. As with other tags the Location is the path to the root of the segment tree in the HSF which contains the geometry representing everything in the sheet.

 

A sheet can only contain <View> tags

 

<View>

Parameters

            Name:                         string, this is optional

            Location:                     string, required parameter

 

A sheet is only a valid tag if the Document is of type drawing. As with other tags the Location is the path to the root of the segment tree in the HSF which contains the geometry representing everything in the sheet.

 

A sheet can only contain <Assembly> and/or <Part> tags.

 

Technical Notes

  • Name parameters do not have a size limit, however, Location and InstanceLocatino strings cannot exceed 2^15 (~32,000) characters.
  • Location and InstanceLocation strings follows the HOOPS/3dGS segment naming convention, which is similar to that of a UNIX file system. This means that relative and absolute file paths are supported.
  • To support multi-document environments HSFs do not contain absolute paths, this should be reflected in the Location and InstanceLocations paths.
  • An instance does not need to reside in the Library.
  • If you are using an Instance then the InstanceLocation must match the Location of the object Instanced.
  • The name of an object which is instanced does not need to match the name of the instance.

Examples

Example1

In this example the file contains the wheel of a car

 

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

<DocumentStructure Name="Explorer Wheel">

  <Part Name="Wheel" Location="./wheel" />

</DocumentStructure>

 

Example2

In this example we have an assembly of simple shock absorber.

 

<?xml version="1.0" encoding="UTF-8" ?>
<DocumentStructure Name="Shock Absorber">
<Library>
  <Part Name="Clamp212" Location="../shared/clamp012" />
  <Part Name="Spring249" Locatin="../shared/spring249" />
</Library>
<Document type=”assembly”>
  <Assembly Name=”Shock Absorber” Location=”./Shock”>
    <Part Name=”Spring” Location=”./Shock/Spring” InstanceLocation=”../shared/spring249” />
    <Part Name=”Body” Location=”./Shock/Body”>
    <Part Name=”Rod” Location=”./Shock/Rod”
    <Part Name=”Clamp” Location=”./Shock/Clamp” InstanceLocation=”../shared/clamp012” />
</Assembly>
</Document>
</DocumentStructure>

 

 

Example3

In this example we have the simple shock assembly included in a standard drawing.

 

<?xml version="1.0" encoding="UTF-8" ?>
<DocumentStructure Name=”ShockDesignSheet”>
  <Library>
    <Part Name=”Clamp212” Location=”../shared/clamp012” />
    <Part Name=”Spring249” Location=”../shared/spring249” />
    <Assembly Name=”Shock Absorber” Location=”../Shared/Shock”>
      <Part Name=”Spring” Location=”../Shared/Shock/Spring” InstanceLocation=”../shared/spring249” />
      <Part Name=”Body” Location=”../Shared/Shock/Body” />
      <Part Name=”Rod” Location=”../Shared/Shock/Rod” />
      <Part Name=”Clamp” Location=”../Shared/Shock/Clamp” Instance Location=”../shared/clamp012” />
   </Assembly>
</Library>
  <Document type=”drawing”>
    <Sheet Name=”Two Views” Location=”./Sheet1”>
      <View Name=”Front” Location=”./Sheet1/View0” >
        <Assembly Name=”Shock Absorber” Location=”./Sheet1/View0/Model” InstanceLocation=”../shared/Shock” />
      </View>
      <View Name=”Side” Location=”./Sheet1/View0” >
        <Assembly Name=”Shock Absorber” Location=”./Sheet1/View0/Model” InstanceLocation=”../shared/Shock” />
      </View>
    </Sheet>
    <Sheet Name=” Bill of Materials” Location=”./Sheet2”>
      <View Name=”Isometric View” Location=”./Sheet2/IsoView”>
        <Assembly Name=”Shock Absorber” Location=”./Sheet2/IsoView/Model” InstanceLocation=”../shared/Shock” />
      </View>
    </Sheet>
  </Document>
</DocumentStructure>