ExportTypeExtension Class |
Namespace: CTExtensions.Interfaces
The ExportTypeExtension type exposes the following members.
Name | Description | |
---|---|---|
AllowUseInSWPDM |
Export Type Extensions need to specify whether or not they support running in SOLIDWORKS PDM context.
| |
CreateExportProfileSettingsControl |
Override majority of the settings page with your custom control.
| |
Dispose |
Called when the settings page is closed.
You may dispose everything.
| |
ExtraButtonClicked |
Called when user clicks the [...] button next to profile type combo.
The button is available for clicking only if GetSettingsViewOpts
returns CTEngineLib.ctExportSettingsViewOpt.ctExportSettingsViewOptNone in its
bitmask.
| |
FieldChanging |
Notification that user is about to edit given field.
| |
FieldDeleting |
Notification that user is about too delete given field.
| |
GetParent |
Must implement. Return parent CTExtension of this export extension.
| |
GetSettingsViewOpts |
Return arbitrary option flags for the settings page.
See ctExportSettingsViewOpt for possible flags.
| |
Init |
Called when this extension is selected from the export type combo
for the first time. Immediately after this TypeSelected
is also called.
| |
ProfileOptionsComboString |
Name that is shown in profile type combo.
By default this is parents FriendlyName.
| |
Save |
Called when user clicks OK at export profile settings.
| |
SupportsSilentExecution |
Export extensions that support silent execution can be executed blindly on
some host machine or on background. When executed silently, the export profile must
not expect any user input.
If you return true, your export extension MUST also subscribe to OnExportProfileSelected and
execute silently when RequestSilentExport -flag is true. The add-in
must also verify its silent export ability with VerifySilentExportSupport.
If it's possible that the extension might fail to export in some cases, also OnQueryExportSuccess
must be subscribed and handled in order to provide error information on silent export cases.
Extensions ability to support silent execution is stored to export profile when the Export Profile is saved at the Profile Options
so this must not be a dynamic ability of the extension. Silent export allows executing the export profile on separate host in PDM.
| |
TypeDiscarded |
Called when user had this export type selected, but
then selected some other type. Return true to
prevent user from changing to another type. This is mainly
meant fot extensions to
| |
TypeSelected |
Notification that this type was just selected from
profile type combo. If the selection happens for the first
time during the setting dialogs lifetime, this call is
preceeded with Init(CTExportProfile).
|
// @AUTO-REFERENCE { [CT_INSTALL_PATH]\CTInterface.dll } // @AUTO-REFERENCE { [CT_INSTALL_PATH]\Interop.CTEngineLib.dll } using ATR.CT.CTInterface; using CTExtensions; using CTEngineLib; using CTExtensions.Interfaces; public class MyAddin : CTExtension { private MyExportExtension moExpExt; public override bool Hook(CTInterface oCTInterface) { bool bHooked = false; if (oCTInterface != null) { // Hook to CTInterface events and set bHooked = true. // Since this extension returns customized ExportTypeExtension, // this implementation will consume all events during export procedure // if the export profile has this extension set as profile type. } return bHooked; } public override void UnHook(CTInterface oCTInterface) { if (oCTInterface != null) { // Un-Hook all handlers from CTInterface } } /// <summary> /// Return the custom interface on request. /// </summary> public override IExtensionInterface GetInterface(ctExtensionInterface eType) { if (eType == ctExtensionInterface.ctExtensionInterfaceIExportType) { if (moExpExt == null) moExpExt = new MyExportExtension(this); return moExpExt; } return null; } /// <summary> /// Create custom implementation for ExportTypeExtension. /// Minimal implementation needs only to return parent extension. /// </summary> class MyExportExtension : ExportTypeExtension { private MyAddin moParent; public MyExportExtension(MyAddin oParent) { moParent = oParent; } public override ICTExtension GetParent() { return moParent; } } }
CUSTOMTOOLS 2017 SP1