6. Macro Function

6.0. Overview

Work in progress

6.#. Function List

PDI.File Functions

PDI.File.GetFileName()

 Opens a file dialog. When a single file is selected, returns the filename (full path).

PDI.File.GetFileNames()

 Opens a file dialog. When multiple files are selected, returns their filenames (full paths) as an array.

PDI.File.GetDirectoryPath(string filename)

 Takes a full path filename as an argument and returns the directory path where the file is located.

PDI.File.ReadProfiles(string filename)

 Takes a full path filename as an argument and opens the file as a profile. If filename is omitted, a file open dialog opens.

PDI.File.SaveProfiles(string filename)

 Takes a full path filename as an argument and saves the current profile. If filename is omitted, a file save dialog opens.

PDI.File.ReadCrystals(string filename)

 Takes a full path filename as an argument and opens the file as a crystal list. If filename is omitted, a file open dialog opens.

PDI.File.SaveCrystals(string filename)

 Takes a full path filename as an argument and saves the current crystal list. If filename is omitted, a file save dialog opens.

PDI.File.SaveMetafile(string filename)

 Takes a full path filename as an argument and saves the currently displayed profiles and crystal peaks as a metafile. If filename is omitted, a file save dialog opens.

PDI.File.SaveText(string text, string filename)

 Saves the string stored in the text variable with the specified filename (full path). If filename is omitted, a file save dialog opens.


PDI.Drawing Functions

PDI.Drawing.SetBounds(int StartX, int EndX, int StartY, int EndY)

 Sets the display area of the profile (upper/lower limits in the X-axis direction and upper/lower limits in the Y-axis direction).

PDI.Drawing.StartX

 Sets/gets the lower limit of the X-axis display.

PDI.Drawing.EndX

 Sets/gets the upper limit of the X-axis display.

PDI.Drawing.StartY

 Sets/gets the lower limit of the Y-axis display.

PDI.Drawing.EndY

 Sets/gets the upper limit of the Y-axis display.

PDI.Drawing.MinimumX

 Sets/gets the lower limit of the X-axis.

PDI.Drawing.MaximumX

 Sets/gets the upper limit of the X-axis.

PDI.Drawing.MinimumY

 Sets/gets the lower limit of the Y-axis.

PDI.Drawing.MaximumY

 Sets/gets the upper limit of the Y-axis.


PDI.Crystal Functions

PDI.Crystal.Name

 Gets/sets the name of the selected crystal.

PDI.Crystal.CellVolume

 Gets the volume (Å^3) of the selected crystal.

PDI.Crystal.Pressure(float volume)

 Gets the pressure when the currently selected crystal has a volume of volume (Å^3). If volume is omitted, the pressure is calculated based on the current volume. For valid values, the EOS of the crystal must be correctly set.

PDI.Crystal.CellA

 Gets the lattice parameter a (Å) of the selected crystal.

PDI.Crystal.CellB

 Gets the lattice parameter b (Å) of the selected crystal.

PDI.Crystal.CellC

 Gets the lattice parameter c (Å) of the selected crystal.

PDI.Crystal.CellAlpha

 Gets the lattice parameter α (°) of the selected crystal.

PDI.Crystal.CellBeta

 Gets the lattice parameter β (°) of the selected crystal.

PDI.Crystal.CellGamma

 Gets the lattice parameter γ (°) of the selected crystal.


PDI.CrystalList Functions

PDI.CrystalList.Open()

 Opens the crystal list window.

PDI.CrystalList.Close()

 Closes the crystal list window.

PDI.CrystalList.Count

 Gets the total number of crystals in the crystal list.

PDI.CrystalList.SelectedName

 Gets the name of the currently selected crystal.

PDI.CrystalList.SelectedIndex

 Gets the index of the currently selected crystal. Alternatively, assigns an index to change the selected crystal.

PDI.CrystalList.Select(int index)

 Selects the crystal at the specified index.

PDI.CrystalList.Check(int index)

 Checks the crystal at the specified index. If index is omitted, checks the currently selected crystal.

PDI.CrystalList.Uncheck(int index)

 Unchecks the crystal at the specified index. If index is omitted, unchecks the currently selected crystal.


PDI.Profile Functions

PDI.Profile.Comment

 Gets/sets the comment of the selected profile.

PDI.Profile.Name

 Gets/sets the name of the selected profile.


PDI.ProfileOperator Functions

PDI.ProfileOperator.Average(int[] indices, string output)

 Calculates the average of profiles specified by indices (integer array) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.AddTwoProfiles(int index1, int index2, string output)

 Calculates the sum of two profiles specified by index1 (integer) and index2 (integer) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.SubtractTwoProfiles(int index1, int index2, string output)

 Calculates the difference of two profiles specified by index1 (integer) and index2 (integer) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.MultiplyTwoProfiles(int index1, int index2, string output)

 Calculates the product of two profiles specified by index1 (integer) and index2 (integer) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.DivideTwoProfiles(int index1, int index2, string output)

 Calculates the quotient of two profiles specified by index1 (integer) and index2 (integer) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.AddValueToProfile(int index1, double value, string output)

 Multiplies the profile specified by index (integer) by value (real number) and outputs as a profile with the name specified by output.

PDI.ProfileOperator.MultiplyValueToProfile(int index1, double value, string output)

 Divides the profile specified by index (integer) by value (real number) and outputs as a profile with the name specified by output.


PDI.ProfileList Functions

PDI.ProfileList.Open()

 Opens the profile list window.

PDI.ProfileList.Close()

 Closes the profile list window.

PDI.ProfileList.Count

 Gets the total number of profiles.

PDI.ProfileList.SelectedName

 Gets the name of the selected profile.

PDI.ProfileList.SelectedIndex

 Gets the index of the selected profile. Alternatively, assigns an index to select a profile.

PDI.ProfileList.Select(int index)

 Selects the profile at the specified index (integer).

PDI.ProfileList.Check(int index)

 Checks the profile at the specified index (integer). If index is omitted, checks the currently selected profile.

PDI.ProfileList.Uncheck(int index)

 Unchecks the profile at the specified index (integer). If index is omitted, unchecks the currently selected profile.

PDI.ProfileList.CheckAll()

 Checks all profiles.

PDI.ProfileList.UncheckAll()

 Unchecks all profiles.

PDI.ProfileList.DeleteAll()

 Deletes all profiles.

PDI.ProfileList.Delete(int index)

 Deletes the profile at the specified index (integer).


PDI.Fitting Functions

PDI.Fitting.Open()

 Opens the peak fitting window.

PDI.Fitting.Close()

 Closes the peak fitting window.

PDI.Fitting.Select(int index)

 Selects the crystal plane at the specified index (integer).

PDI.Fitting.SelectedIndex

 Gets the index of the currently selected crystal plane. Alternatively, assigns an index to select a crystal plane.

PDI.Fitting.Check(int index)

 Checks the crystal plane at the specified index (integer). If index is omitted, checks the currently selected crystal plane.

PDI.Fitting.Uncheck(int index)

 Unchecks the crystal plane at the specified index (integer). If index is omitted, unchecks the currently selected crystal plane.

PDI.Fitting.Range(double value)

 Specifies the fitting range for the selected crystal plane.

PDI.Fitting.Apply()

 Applies the optimized lattice parameters to the selected crystal.


PDI.Sequential Functions

PDI.Sequential.Open()

 Opens the sequential analysis window.

PDI.Sequential.Close()

 Closes the sequential analysis window.

PDI.Sequential.Execute()

 Executes sequential analysis.

PDI.Sequential.GetCSV_2theta()

 Gets the sequential analysis results (2theta) in CSV format.

PDI.Sequential.GetCSV_D()

 Gets the sequential analysis results (d-value) in CSV format.

PDI.Sequential.GetCSV_FWHM()

 Gets the sequential analysis results (full width at half maximum) in CSV format.

PDI.Sequential.GetCSV_Intensity()

 Gets the sequential analysis results (peak intensity) in CSV format.

PDI.Sequential.GetCSV_CellConstants()

 Gets the sequential analysis results (lattice parameters) in CSV format.

PDI.Sequential.GetCSV_Pressure()

 Gets the sequential analysis results (pressure) in CSV format.

PDI.Sequential.GetCSV_Singh()

 Gets the sequential analysis results (Singh equation) in CSV format.


contents