The procedure for requesting AWR support has changed. Please read all about the new AWR product support process.
Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Once you've downloaded and installed PowerShell you can get started right away working with the AWR Design Environment. To create and instance of AWR DE enter the following at the command line:

Code Snippets

PS C:\> $MWOffice = new-object -comobject "AWR.MWOffice"

This line tells powershell to create a new object of type comobject with the Program ID (ProgID) of "AWR.MWOffice" which is the Program ID for the latest version of MWOffice installed on your system. If you have more than one version and would like create an instance of a particular version you can do so with the following commands.

 

PS C:\> $MWOffice = new-object -comobject AWR.MWOffice.1314.0

will create an instance of version 1314.0.

Now that we have a reference to a running instance of AWR DE in the variable $MWOffice we can use it to see what members this object has. Enter the command:

...

From here we can easily look at the parameters for the element using:

PS C:\Documents and Settings\dupree>> $Element.Parameters

This enumerates the element parameters and prints a summary for each. However this type of output is fairly verbose so lets just look at the parameter name and value as string.

PS C:\> $Element.Parameters | foreach-object \{ $_.Name + " = "+ $_.ValueAsString \}
ID = TL1
W = 20
L = 200
MSUB =

...

PS C:\> $Element.Parameters.Item("W").ValueAsString = "40"
PS C:\> $Element.Parameters | foreach-object \{ $_.Name + " = "+ $_.ValueAsString \}
ID = TL1
W = 40
L = 200
MSUB =

...