Methods and Properties Introduced:
|
|
pfcFileOpenOptions.Create() |
|
|
pfcFileOpenOptions.FilterString |
|
|
pfcFileOpenOptions.PreselectedItem |
|
|
pfcFileUIOptions.DefaultPath |
|
|
pfcFileUIOptions.DialogLabel |
|
|
pfcFileUIOptions.Shortcuts |
|
|
pfcFileOpenShortcut.Create |
|
|
pfcFileOpenShortcut.ShortcutName |
|
|
pfcFileOpenShortcut.ShortcutPath |
|
|
pfcFileSaveOptions.Create() |
|
|
pfcSession.UISelectDirectory() |
|
|
pfcDirectorySelectionOptions.Create() |
The method pfcSession.UIOpenFile() opens the relevant dialog box for browsing directories and opening files. The method lets you specify several options through
the input arguments pfcFileOpenOptions and pfcFileUIOptions.
The method pfcSession.UIOpenFile() returns the file selected by you. The application must use other properties or techniques to perform the desired action on
the file.
Use the method pfcFileOpenOptions.Create() to create a new instance of the pfcFileOpenOptions object. A list of options for this object with a description about what each option specifies, follows:
|
• |
FilterString—Filter string for the type of file accepted by the dialog box. Multiple file types should be listed with wildcards and separated
by commas, for example, *.prt, *.asm, *.txt, *.avi, and so on. Use the property pfcFileOpenOptions.FilterString to set this option. |
|
• |
PreselectedItem—Specifies the name of an item to preselect in the dialog box. Use the property pfcFileOpenOptions.PreselectedItem to set this option. |
The pfcFileUIOptions object contains the following options:
|
• |
DefaultPath—Specifies the name of the path to be opened by default in the dialog box. Use the property pfcFileUIOptions.DefaultPath to set this option. |
|
• |
DialogLabel—Specifies the title of the dialog box. Use the property pfcFileUIOptions.DialogLabel to set this option. |
|
• |
Shortcuts—Array of file shortcuts of the type pfcFileOpenShortcut. Create this object using the property pfcFileOpenShortcut.Create. This object contains the following attributes:
|
○
|
ShortcutName—Specifies the name of shortcut path to be made available in the dialog box. |
|
○
|
ShortcutPath—Specifies the string for the shortcut path. |
|
Use the property pfcFileOpenShortcut.ShortcutName to set the string for the shortcut name.
Use the property pfcFileOpenShortcut.ShortcutPath to set the string for the shortcut path.
Use the property pfcFileUIOptions.Shortcuts to set the array of file shortcuts.
The method pfcSession.UISaveFile() opens the dialog box for saving a file. The method accepts options similar to pfcSession.UIOpenFile() through the pfcFileSaveOptions and pfcFileUIOptions objects. Use the method pfcFileSaveOptions.Create() to create a new instance of the pfcFileSaveOptions object. When using the Save dialog box, you can set the name to a nonexistent file. The method pfcSession.UISaveFile() returns the name of the file selected by you; the application must use other methods or techniques to perform the desired
action on the file.
The method pfcSession.UISelectDirectory() prompts the user to select a directory using the Creo Parametric dialog box for browsing directories. The method accepts options through the pfcDirectorySelectionOptions object which is similar to the pfcFileUIOptions object (described for the method pfcSession.UIOpenFile()). Specify the default directory path, the title of the dialog box, and a set of shortcuts to other directories to start browsing.
If the default path is specified as NULL, the current directory is used. Use the method pfcDirectorySelectionOptions.Create() to create a new instance of the pfcDirectorySelectionOptions object. The method pfcSession.UISelectDirectory() returns the selected directory path; the application must use other methods or techniques to perform other tasks with this
selected path.