Methods and Properties Introduced:
|
|
CCpfcFileOpenOptions.Create() |
|
|
IpfcFileOpenOptions.FilterString |
|
|
IpfcFileOpenOptions.PreselectedItem |
|
|
IpfcFileUIOptions.DefaultPath |
|
|
IpfcFileUIOptions.DialogLabel |
|
|
IpfcFileUIOptions.Shortcuts |
|
|
CCpfcFileOpenShortcut.Create() |
|
|
IpfcFileOpenShortcut.ShortcutName |
|
|
IpfcFileOpenShortcut.ShortcutPath |
|
|
CCpfcFileSaveOptions.Create() |
|
|
IpfcSession.UISelectDirectory() |
|
|
CCpfcDirectorySelectionOptions.Create() |
|
|
IpfcBaseSession.UIRegisterFileOpen |
|
|
CCpfcFileOpenRegisterOptions.Create |
|
|
IpfcFileOpenRegisterOptions.FileDescription |
|
|
IpfcFileOpenRegisterOptions.FileType |
|
|
IpfcFileOpenRegisterListener.FileOpenAccess |
|
|
IpfcFileOpenRegisterListener.OnFileOpenRegister |
|
|
IpfcBaseSession.UIRegisterFileSave |
|
|
CCpfcFileSaveRegisterOptions.Create |
|
|
IpfcFileSaveRegisterOptions.FileDescription |
|
|
IpfcFileSaveRegisterOptions.FileType |
|
|
IpfcFileSaveRegisterListener.FileSaveAccess |
|
|
IpfcFileSaveRegisterListener.OnFileSaveRegister |
The method IpfcSession.UIOpenFile() opens the relevant dialog box for browsing directories and opening files. The method lets you specify several options through
the input arguments IpfcFileOpenOptions and IpfcFileUIOptions.
Use the method CCpfcFileOpenOptions.Create() to create a new instance of the IpfcFileOpenOptions object. This object contains the following options:
|
• |
FilterString—Specifies the 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 IpfcFileOpenOptions.FilterString to set this option. |
|
• |
PreselectedItem—Specifies the name of an item to preselect in the dialog box. Use the property IpfcFileOpenOptions.PreselectedItem to set this option. |
The IpfcFileUIOptions object contains the following options:
|
• |
DefaultPath—Specifies the name of the path to be opened by default in the dialog box. Use the property IpfcFileUIOptions.DefaultPath to set this option. |
|
• |
DialogLabel—Specifies the title of the dialog box. Use the property IpfcFileUIOptions.DialogLabel to set this option. |
|
• |
Shortcuts—Specifies an array of file shortcuts of the type IpfcFileOpenShortcut. Create this object using the method CCpfcFileOpenShortcut.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 IpfcFileUIOptions.Shortcuts to set the array of file shortcuts.
|
The method IpfcSession.UIOpenFile() returns the file selected by you. The application must use other methods or techniques to perform the desired action on the
file.
The method IpfcSession.UISaveFile() opens the relevant dialog box for saving a file. The method accepts options similar to IpfcSession.UIOpenFile() through the IpfcFileSaveOptions and IpfcFileUIOptions objects. Use the method CCpfcFileSaveOptions.Create() to create a new instance of the IpfcFileSaveOptions object. When using the Save dialog box, you can set the name to a non-existent file. The method IpfcSession.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 IpfcSession.UISelectDirectory() prompts the user to select a directory using the Creo Parametric dialog box for browsing directories. The method accepts options through the IpfcDirectorySelectionOptions object which is similar to the IpfcFileUIOptions object (described for the method IpfcSession.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 CCpfcDirectorySelectionOptions.Create() to create a new instance of the IpfcDirectorySelectionOptions object. The method IpfcSession.UISelectDirectory() returns the selected directory path; the application must use other methods or techniques to perform other relevant tasks
with this selected path.
The method IpfcBaseSession.UIRegisterFileOpen() registers a new file type in the dialog box in Creo Parametric. This method takes the IpfcFileOpenRegisterOptions and IpfcFileOpenRegisterListener objects as its input arguments. These objects are as follows:
|
• |
IpfcFileOpenRegisterOptions—This object contains the options for registering an open operation. Use the method CCpfcFileOpenRegisterOptions.Create to create a new instance of the object. It contains the following options:
|
○
|
FileDescription—Specifies the short description of the file type to be opened. This description appears for the file type in the dialog box. Use the property IpfcFileOpenRegisterOptions.FileDescription to modify this option. |
|
○
|
FileType—Specifies the file type to be opened. The file type appears as the file extension in the dialog box. Use the property IpfcFileOpenRegisterOptions.FileType to modify this option. |
|
|
• |
IpfcFileOpenRegisterListener—This object provides the action listener methods for the new file type to be registered. The method IpfcFileOpenRegisterListener.FileOpenAccess() is called to determine whether the new file type can be opened using the dialog box. The method IpfcFileOpenRegisterListener.OnFileOpenRegister is called on clicking Open for the newly registered file type. |
The method IpfcBaseSession.UIRegisterFileSave() registers a new file type in the dialog box in Creo Parametric. This method takes the IpfcFileSaveRegisterOptions and IpfcFileSaveRegisterListener objects as its input arguments. These objects are described as follows:
|
• |
IpfcFileSaveRegisterOptions—This object contains the options for registering a save operation. Use the method CCpfcFileSaveRegisterOptions_Create() to create a new instance of the object. It contains the following options:
|
○
|
FileDescription—Specifies the short description of the file type to be saved. This description appears for the file type in the dialog box. Use the property IpfcFileSaveRegisterOptions.FileDescription to modify this option. |
|
○
|
FileType—Specifies the file type to be saved. The file type appears as the file extension in the dialog box. Use the property IpfcFileSaveRegisterOptions.FileType to modify this option. |
|
|
• |
IpfcFileSaveRegisterListener—This object provides the action listener methods for the new file type to be registered. The method IpfcFileSaveRegisterListener.FileSaveAccess() is called to determine whether the new file type can be saved using the dialog box. The method IpfcFileSaveRegisterListener.OnFileSaveRegister is called on clicking OK for the newly registered file type. |