You start by creating a displacement:
d=Model.Analyses[0].AddDisplacement()
In Mechanical, you can see that by default, the variable definition types for the displacement’s X, Y, and Z components are set to Free.

You can verify this by executing the following commands one at a time.
d.XComponent.Output.DefinitionType
d.YComponent.Output.DefinitionType
d.ZComponent.Output.DefinitionType

Note: Even though the expression d.XComponent.Output
would
produce the same output in the console when the component is
Free
, be aware that output is an instance of the
Variable
class. This object is then converted into a
string by the console. Appending .DefinitionType
to the
expression yields the actual enum value.