Document

A Document object is of type PSObject and contains the iProperties of all property sets of an Inventor document:

  • Standard property sets: Inventor Summary Information, Inventor Document Summary Information, Design Tracking Properties,
    Content Library Component Properties and ContentCenter (the last two only for Content Center parts)

  • Inventor User Defined Properties

  • Custom property sets, for example created by add-ins

Syntax

1
2
$document.Title
$document.Title = "Gearbox housing"

Remarks

Accessing properties

The properties are named the same as in Inventor, including spaces. Property names containing spaces must be enclosed in quotes.

The document object supports all Inventor languages:

  • All active properties can be accessed via their display name, which is localized and depends on the Inventor language (e.g. Estimated Cost, Geschätzte Kosten)

  • All active properties can be accessed via their system name with a leading underscore, which is not localized and the same in all Inventor languages (e.g. _Cost)

Note

It is recommended to use the system names, so that scripts work with all Inventor languages.

Duplicate property names

The same property name can exist in more than one property set. Because PowerShell member names are not case-sensitive, $document has only one member per name, even if the names differ only in upper and lower case.

  • If a property of Inventor User Defined Properties has the same name as a property of a standard property set (see above), getting and setting the name uses the user defined property.
    The standard property is still available via its system name with a leading underscore.

  • If several properties with the same name exist in Inventor User Defined Properties or custom property sets, including properties in one property set that differ only in upper and lower case,
    the property that Inventor returns first is used for getting and setting. All other properties with the same name are ignored by $document and a warning is logged.

Setting properties

Properties can be read and set. Setting a property changes the iProperty of the Inventor document, which is persisted the next time the document is saved,
for example when the property is set in a SaveDocument_Pre event.

For an example, see Register-InventorEvent.

Examples

Accessing Cost for different Inventor languages

1
2
3
$document."Estimated Cost" #can be used with English Inventor
$document."Geschätzte Kosten" #can be used with German Inventor
$document._Cost #can be used with all Inventor language environments

Accessing duplicate property names

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Design Tracking Properties:       Part Number = 1000
# Inventor User Defined Properties: Part Number = A-1000
$document."Part Number"  # A-1000
$document."_Part Number" # 1000

# Inventor User Defined Properties: Thickness = Plate, THICKNESS = Imperial
# Custom Property Set:              thickness = Heavy plate
$document.Thickness           # Plate (found first)
$document.THICKNESS           # Plate (same member)
$document.THICKNESS = "Steel" # sets Thickness in Inventor User Defined Properties

Document object on an English environment:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
_Appearance                    : 
_Author                        : Autodesk, Inc.
_Authority                     : 
_Catalog Web Link              : 
_Categories                    : 
_Category                      : 
_Checked By                    : 
_Comments                      : 
_Company                       : Autodesk, Inc.
_Cost                          : 0.0000
_Cost Center                   : 
_Creation Time                 : 11/07/2001 00:00:00
_Date Checked                  : 01/01/1601 00:00:00
_Defer Updates                 : False
_Density                       : 7.333267200572011
_Description                   : 
_Design Status                 : 1
_Designer                      : Autodesk, Inc.
_Document SubType              : {E60F81E1-49B3-11D0-93C3-7E0706000000}
_Document SubType Name         : Assembly
_Engineer                      : 
_Engr Approved By              : 
_Engr Date Approved            : 01/01/1601 00:00:00
_External Property Revision Id : {A1306930-7E55-4F56-912F-973A7762DFAF}
_Flat Pattern Area             : 0
_Flat Pattern Defer Update     : False
_Flat Pattern Length           : 0
_Flat Pattern Width            : 0
_Keywords                      : 
_Language                      : 
_Last Saved By                 : 
_Last Updated With             : 2027.1 (Build 311270010, 270A)
_Manager                       : 
_Manufacturer                  : 
_Mass                          : 52.33436596220094
_Material                      : 
_Material Identifier           : 
_Mfg Approved By               : 
_Mfg Date Approved             : 01/01/1601 00:00:00
_Parameterized Template        : False
_Part Icon                     : 
_Part Number                   : Tuner2
_Part Property Revision Id     : {F943F86A-39B7-4326-8A24-26765D919F5B}
_Project                       : 
_Proxy Refresh Date            : 01/01/1601 00:00:00
_Revision Number               : 
_Revit Category                : 0
_Sheet Metal Area              : 
_Sheet Metal Length            : 
_Sheet Metal Rule              : 
_Sheet Metal Width             : 
_Size Designation              : 
_Standard                      : 
_Standard Revision             : 
_Standards Organization        : 
_Stock Number                  : 
_Subject                       : 
_SurfaceArea                   : 86.62605404758622
_Template Row                  : 
_Thumbnail                     : System.__ComObject
_Title                         : 
_User Status                   : 
_Valid MassProps               : 1
_Vendor                        : 
_Volume                        : 7.13656880770944
_Weld Material                 : 
Appearance                     : 
Area                           : 86.62605404758622
Author                         : Autodesk, Inc.
Authority                      : 
Categories                     : 
Category                       : 
Checked By                     : 
Checked Date                   : 01/01/1601 00:00:00
Comments                       : 
Company                        : Autodesk, Inc.
Cost Center                    : 
Creation Date                  : 11/07/2001 00:00:00
Date proxy refreshed           : 01/01/1601 00:00:00
Defer Updates                  : False
Density                        : 7.333267200572011
Description                    : 
Design State                   : 1
Designer                       : Autodesk, Inc.
Eng. Approved By               : 
Eng. Approved Date             : 01/01/1601 00:00:00
Engineer                       : 
Estimated Cost                 : 0.0000
External Part Revision         : {A1306930-7E55-4F56-912F-973A7762DFAF}
FileName                       : Tuner.iam
Flat Pattern Defer Update      : False
Flat Pattern Extents Width     : 0
Flat PatternExtents Area       : 0
FlatPatternExtentsLength       : 0
FullFileName                   : C:\Users\Manuel\Documents\Vault\Designs\Samples\Models\Assemblies\Tuner\Tuner.iam
IsModifiable                   : True
Keywords                       : 
Language                       : 
Last Saved By                  : 
Last Update with               : 2027.1 (Build 311270010, 270A)
Manager                        : 
Manufacturer                   : 
Mass                           : 52.33436596220094
Material                       : 
Material Identifier            : 
Mfg. Approved By               : 
Mfg. Approved Date             : 01/01/1601 00:00:00
Parameterized Template         : False
Part Icon                      : 
Part Number                    : Tuner2
Part Revision                  : {F943F86A-39B7-4326-8A24-26765D919F5B}
Part Type                      : {E60F81E1-49B3-11D0-93C3-7E0706000000}
Part Type name                 : Assembly
Project                        : 
Revision Number                : 
Revit Category                 : 0
Sheet Metal Area               : 
Sheet Metal Length             : 
Sheet Metal Width              : 
SheetMetalRule                 : 
Size Designation               : 
Standard                       : 
Standard Revision              : 
Standards Organization         : 
Status                         : 
Stock Number                   : 
Subject                        : 
Template Row                   : 
Thumbnail                      : System.__ComObject
Title                          : 
Valid MassProps                : 1
Vendor                         : 
Volume                         : 7.13656880770944
Web Link                       : 
Weld Material                  : 

Additional properties of Content Center parts

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
_Component Type       : 0
_Family               : [CPLG, NPT STANDARD, STEEL]
_Family Folder        : [CPLG, NPT STANDARD, STEEL]
_Family Revision      : e9b8f859-eedb-4d73-ad9a-0f474a175812
_Family Revision Time : 07/04/2014 20:45:54
_FamilyId             : 1e0e8ebe-c7e3-4f47-b324-42da6f01951b
_IsCustomPart         : 0
_Member               : 
_Member FileName      : HALF COUPLING, 0.375 NPT STANDARD, STEEL
_Member Revision      : 604695dd-8409-4c95-82c0-573c46276b5b
_MemberId             : c598a800-b6c4-4133-a868-d15cc342e2d5
Family                : [CPLG, NPT STANDARD, STEEL]
Family Folder         : [CPLG, NPT STANDARD, STEEL]
Family Revision       : e9b8f859-eedb-4d73-ad9a-0f474a175812
Family Revision Time  : 07/04/2014 20:45:54
FamilyId              : 1e0e8ebe-c7e3-4f47-b324-42da6f01951b
IsCustomPart          : 0
Member FileName       : HALF COUPLING, 0.375 NPT STANDARD, STEEL
MemberId              : c598a800-b6c4-4133-a868-d15cc342e2d5