Straight after the header comes the first
object of the MFC archive, a CVersionMap. It lists every class the model may
contain and the version of that class’s layout in this file, and ends with the name
End-Of-Version-Map. The map is how SketchUp knows how each object after it
is laid out, which is what lets a newer SketchUp read an older file. All numbers are
little-endian.
00000050 FF FF 00 00 0B 00 43 56 65 72 73 69 6F 6E 4D 61
00000060 70 FF FE FF …
Layout
| Part | Bytes | Meaning |
|---|---|---|
| Class record | 17 | FF FF 00 00 0B 00 and CVersionMap: a new class, schema 0. |
| Entries | varies | One a class: a CString class name and a u32 version. |
| End | 44 | The CString End-Of-Version-Map and a u32 0. |
Class record
The map is an object, so it starts the way MFC starts the first object of a class: with a new class record (see class tags).
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 2 | u16 | Tag | FFFF, MFC’s new class tag: a class description follows. |
| 2 | 2 | u16 | Schema | The class’s schema number, its layout version as MFC sees it: 0. |
| 4 | 2 | u16 | Name length | The length of the class name in bytes: 11. |
| 6 | 11 | ASCII | Class name | CVersionMap. |
These 17 bytes are the same in every file seen. In SketchUp 8 files they start at 0x50 when the version string has ten characters.
Entries
Each entry names a class and gives its version:
| Offset | Size | Type | Name | Meaning |
|---|---|---|---|---|
| 0 | 4 + 2 × length | CString | Class | The class name, such as CFace. |
| then | 4 | u32 | Version | The version of that class’s layout in this file. |
The entries are in alphabetical order in every file seen. One entry, for the class
CArcCurve at version 1:
FF FE FF 09 43 00 41 00 72 00 63 00 43 00 75 00 72 00 76 00 65 00 01 00 00 00
Fab Lab Iceland’s 2008 notes on a SketchUp 6 file describe each entry as a string and “an 8-byte code”. In the files examined for this site the value after the string is 4 bytes, a version. Whether SketchUp 6 differed has not been confirmed.
Class names
The class names are CStrings in the same form as every other string in the file: the
marker FF FE FF, a length in characters (one byte for names this short) and
the name in UTF-16LE (see Strings).
The name in the class record before them, by contrast, is MFC’s own class name in
ASCII.
End of the map
The last entry has the name End-Of-Version-Map (18 characters,
12 hex) and the version 0:
FF FE FF 12 45 00 6E 00 64 00 2D 00 4F 00 66 00 2D 00 56 00
65 00 72 00 73 00 69 00 6F 00 6E 00 2D 00 4D 00 61 00 70 00 00 00 00 00
The model’s first fields follow straight after it.
Reading the map
- Read the class record and check for
FFFF, schema 0 and the nameCVersionMap. - Read a CString, then a u32. Store the pair.
- If the string was
End-Of-Version-Map, stop: the map is complete. Otherwise go back to step 2. - Look up the version of each class before reading an object of it. For this format,
CEntityis below 5.
Classes and their versions
The SketchUp 8 file holds 55 classes, the 2015 and 2016 files 58: SketchUp 2015 added
CSchemaFile, CSchemaFilterFile and CSchemaZipFile.
All 58 are listed here from the files examined. A dash means the class is not in the
map. What each version’s number means for the class’s layout is on the
Classes page.
| Class | SketchUp 8 | 2015 | 2016 |
|---|---|---|---|
CArcCurve | 1 | 3 | 3 |
CAttribute | 0 | 0 | 0 |
CAttributeContainer | 0 | 0 | 0 |
CAttributeNamed | 1 | 1 | 1 |
CBackgroundImage | 10 | 10 | 10 |
CCamera | 5 | 5 | 5 |
CComponent | 11 | 11 | 11 |
CComponentBehavior | 5 | 5 | 5 |
CComponentDefinition | 10 | 10 | 10 |
CComponentInstance | 4 | 5 | 5 |
CConstructionGeometry | 0 | 0 | 0 |
CConstructionLine | 1 | 1 | 1 |
CConstructionPoint | 0 | 0 | 0 |
CCurve | 4 | 4 | 4 |
CDefinitionList | 0 | 0 | 0 |
CDib | 3 | 3 | 3 |
CDimension | 1 | 1 | 1 |
CDimensionLinear | 6 | 6 | 6 |
CDimensionRadial | 2 | 2 | 2 |
CDimensionStyle | 4 | 4 | 4 |
CDrawingElement | 9 | 9 | 9 |
CEdge | 2 | 2 | 2 |
CEdgeUse | 1 | 1 | 1 |
CEntity | 3 | 3 | 3 |
CFace | 3 | 3 | 3 |
CFaceTextureCoords | 4 | 4 | 4 |
CFontManager | 0 | 0 | 0 |
CGroup | 1 | 1 | 1 |
CImage | 1 | 1 | 1 |
CLayer | 2 | 2 | 2 |
CLayerManager | 4 | 4 | 4 |
CLoop | 1 | 1 | 1 |
CMaterial | 12 | 12 | 12 |
CMaterialManager | 4 | 4 | 4 |
CPageList | 1 | 1 | 1 |
CPolyline3d | 0 | 0 | 0 |
CRelationship | 0 | 0 | 0 |
CRelationshipMap | 0 | 0 | 0 |
CRenderingOptions | 36 | 36 | 36 |
CSchemaFile | – | 1 | 1 |
CSchemaFilterFile | – | 0 | 0 |
CSchemaZipFile | – | 1 | 1 |
CSectionPlane | 2 | 2 | 2 |
CShadowInfo | 7 | 7 | 7 |
CSkFont | 1 | 1 | 1 |
CSketchCS | 0 | 0 | 0 |
CSketchUpModel | 22 | 24 | 25 |
CSketchUpPage | 1 | 1 | 1 |
CSkpStyle | 1 | 1 | 1 |
CSkpStyleManager | 2 | 2 | 2 |
CText | 9 | 9 | 9 |
CTextStyle | 5 | 5 | 5 |
CTexture | 6 | 6 | 6 |
CThumbnail | 1 | 1 | 1 |
CVertex | 0 | 0 | 0 |
CViewPage | 12 | 12 | 12 |
CWatermark | 1 | 1 | 1 |
CWatermarkManager | 2 | 2 | 2 |
Between SketchUp 8 and 2016, CSketchUpModel, CArcCurve and
CComponentInstance changed schema, and their layouts changed with them, as
the Classes page shows. CEntity,
the base of every entity, stays at 3; at schema 5 the file is a
SketchUp 2017 to 2020 model.
SketchUp 3 to 7
One real SketchUp 7 file (7.0.10247) was available here: its map matches
the SketchUp 7 column below class for class, and it decodes whole. For SketchUp 3 to
6 no real file was available. skppy publishes the schema of the classes that differ, and
its test suite skppy-tests checks
them against fixtures SketchUp’s SDK saves for every target from SketchUp 3 on. A dash means the class is not in that map; classes
not listed have the same schema as in SketchUp 8.
| Class | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|
CAttribute | – | 0 | 0 | 0 | 0 | 0 |
CAttributeContainer | – | 0 | 0 | 0 | 0 | 0 |
CAttributeNamed | – | 0 | 0 | 0 | 1 | 1 |
CBackgroundImage | – | – | – | 1 | 9 | 10 |
CCamera | – | 4 | 4 | 5 | 5 | 5 |
CComponentBehavior | 3 | 4 | 4 | 4 | 5 | 5 |
CComponentInstance | 3 | 3 | 4 | 4 | 4 | 4 |
CConstructionLine | 0 | 1 | 1 | 1 | 1 | 1 |
CCurve | 3 | 4 | 4 | 4 | 4 | 4 |
CDib | 2 | 2 | 2 | 3 | 3 | 3 |
CDimension | 0 | 0 | 0 | 1 | 1 | 1 |
CDimensionLinear | 4 | 4 | 4 | 6 | 6 | 6 |
CDrawingElement | 8 | 8 | 9 | 9 | 9 | 9 |
CEntity | 2 | 3 | 3 | 3 | 3 | 3 |
CFaceTextureCoords | – | 4 | 4 | 4 | 4 | 4 |
CLayer | 1 | 2 | 2 | 2 | 2 | 2 |
CPageList | – | 1 | 1 | 1 | 1 | 1 |
CRenderingOptions | 22 | 25 | 28 | 32 | 35 | 36 |
CSkFont | 0 | 0 | 0 | 1 | 1 | 1 |
CSketchUpModel | 10 | 12 | 12 | 18 | 22 | 22 |
CSkpStyle | – | – | – | 1 | 1 | 1 |
CSkpStyleManager | – | – | – | 2 | 2 | 2 |
CTextStyle | 4 | 4 | 4 | 5 | 5 | 5 |
CTexture | 4 | 4 | 4 | 6 | 6 | 6 |
CThumbnail | 0 | 1 | 1 | 1 | 1 | 1 |
CViewPage | 6 | 9 | 9 | 11 | 11 | 12 |
CWatermarkManager | – | – | – | 2 | 2 | 2 |
The body of a class is always read with the schema in the map, not the one in the class’s own record: a newer SketchUp saving to an older format can write a later class record. A class with no published layout for its schema stops the reader, which reports it.