-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
612 additions
and
5 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
# Definition | ||
|
||
The task setup button hook gets triggered when you click on the OK or Cancel button in the following window. | ||
|
||
The task setup hook allows you to save data into the task. It also gives the ability add context menu if your task defines that in task flags. | ||
|
||
|
||
# Saving task page's data | ||
|
||
>[!WARNING] | ||
> You must reuse the same instance from the TaskSetup hook. | ||
- Call the method StoreData in your EdmTaskPage. | ||
- You may also call AddContextMenu to add a right-click that triggers the task launch from File Explorer. | ||
|
||
|
||
See the complete code example below. | ||
|
||
# Example | ||
|
||
|
||
# [C Sharp](#tab/cs) | ||
``` | ||
Pages.Messaging taskSetupMessagingTab = default(Pages.Messaging); | ||
public override void OnCmd(ref EdmCmd poCmd, ref EdmCmdData[] ppoData) | ||
{ | ||
base.OnCmd(ref poCmd, ref ppoData); | ||
int handle = poCmd.mlParentWnd; | ||
try | ||
{ | ||
switch (poCmd.meCmdType) | ||
{ | ||
case EdmCmdType.EdmCmd_TaskSetup: | ||
{ | ||
taskSetupMessagingTab = new Pages.Messaging(); | ||
taskSetupMessagingTab.Container = base.Container; | ||
AddTaskSetupPage(taskSetupMessagingTab); | ||
// or if you have multiple pages | ||
// AddTaskSetupPages(new BlueByte.SOLIDWORKS.PDMProfessional.SDK.Core.ITaskPage[] { taskSetupMessagingTab}); | ||
} | ||
break; | ||
case EdmCmdType.EdmCmd_TaskSetupButton: | ||
{ | ||
// add a context menu | ||
AddContextMenu($"Tasks\\{Properties.TaskName} [V{Identity.Version}]", Identity.Description); | ||
// save the data of the tab | ||
taskSetupMessagingTab.StoreData(ref poCmd); | ||
} | ||
break; | ||
case EdmCmdType.EdmCmd_TaskDetails: | ||
break; | ||
case EdmCmdType.EdmCmd_TaskRun: | ||
break; | ||
case EdmCmdType.EdmCmd_TaskLaunch: | ||
break; | ||
case EdmCmdType.EdmCmd_TaskLaunchButton: | ||
default: | ||
break; | ||
} | ||
} | ||
catch (CancellationException e) | ||
{ | ||
throw; | ||
} | ||
catch (TaskFailedException e) | ||
{ | ||
throw; | ||
} | ||
// this is a PDM exception | ||
catch (COMException e) | ||
{ | ||
throw; | ||
} | ||
catch (Exception e) | ||
{ | ||
throw; | ||
} | ||
} | ||
``` | ||
# [VB](#tab/VB) | ||
``` | ||
Private taskSetupMessagingTab As Pages.Messaging = Nothing | ||
Public Overrides Sub OnCmd(ByRef poCmd As EdmCmd, ByRef ppoData() As EdmCmdData) | ||
MyBase.OnCmd(poCmd, ppoData) | ||
Dim handle As Integer = poCmd.mlParentWnd | ||
Try | ||
Select Case poCmd.meCmdType | ||
Case EdmCmdType.EdmCmd_TaskSetup | ||
taskSetupMessagingTab = New Pages.Messaging() | ||
taskSetupMessagingTab.Container = MyBase.Container | ||
AddTaskSetupPage(taskSetupMessagingTab) | ||
' Or if you have multiple pages | ||
' AddTaskSetupPages(New BlueByte.SOLIDWORKS.PDMProfessional.SDK.Core.ITaskPage() {taskSetupMessagingTab}) | ||
Case EdmCmdType.EdmCmd_TaskSetupButton | ||
' Add a context menu | ||
AddContextMenu($"Tasks\{Properties.TaskName} [V{Identity.Version}]", Identity.Description) | ||
' Save the data of the tab | ||
taskSetupMessagingTab.StoreData(poCmd) | ||
Case EdmCmdType.EdmCmd_TaskDetails | ||
' Implement task details logic here | ||
Case EdmCmdType.EdmCmd_TaskRun | ||
' Implement task run logic here | ||
Case EdmCmdType.EdmCmd_TaskLaunch | ||
' Implement task launch logic here | ||
Case EdmCmdType.EdmCmd_TaskLaunchButton | ||
' Implement task launch button logic here | ||
Case Else | ||
' Default case logic | ||
End Select | ||
Catch e As CancellationException | ||
Throw | ||
Catch e As TaskFailedException | ||
Throw | ||
' This is a PDM exception | ||
Catch e As COMException | ||
Throw | ||
Catch e As Exception | ||
Throw | ||
End Try | ||
End Sub | ||
``` | ||
--- | ||
|
||
# Debugging | ||
|
||
>[!IMPORTANT] | ||
> You cannot debug task setup pages with *Debug Add-ins...* | ||
|
||
- Make sure you have a fresh connection to PDM. Generally speaking, this is done by killing Conisioadmin.exe, edmserver.exe and explorer.exe and then restarting explorer.exe. This process can be done from the Windows task manager. | ||
- Call AttachDebugger in your OnCmd. | ||
- Compile code. | ||
- Add the project files to your vault from the administration tool. Right-click on *Add-ins* and click *New Add-in...* | ||
- Accept all dialogs. | ||
- Right-click on *Tasks* and click *New...* | ||
- Choose the add-in that you just added from the dropdown. | ||
- AttachDebugger will be called immediately and you can attach Visual Studio to start debugging through your code. | ||
|
||
|
||
>[!TIP] | ||
> You can use the directives #if DEBUG #endif to conditionally compile the AttachDebugger in the debug configuration. This will ignore it in the Release configuration which you can use in production. Be aware that release configurations do not automatically generate pdb files so your stack traces will not print in your error or logs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title> | SOLIDWORKS PDM SDK </title> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="title" content=" | SOLIDWORKS PDM SDK "> | ||
|
||
|
||
<link rel="icon" href="../favicon.ico"> | ||
<link rel="stylesheet" href="../public/docfx.min.css"> | ||
<link rel="stylesheet" href="../public/main.css"> | ||
<meta name="docfx:navrel" content="../toc.html"> | ||
<meta name="docfx:tocrel" content="toc.html"> | ||
|
||
<meta name="docfx:rel" content="../"> | ||
|
||
|
||
<meta name="docfx:docurl" content="https://github.com/BlueByteSystemsInc/PDMFramework/blob/master/docfx/docs/TaskDetails.md/#L1"> | ||
<meta name="loc:inThisArticle" content="In this article"> | ||
<meta name="loc:searchResultsCount" content="{count} results for "{query}""> | ||
<meta name="loc:searchNoResults" content="No results for "{query}""> | ||
<meta name="loc:tocFilter" content="Filter by title"> | ||
<meta name="loc:nextArticle" content="Next"> | ||
<meta name="loc:prevArticle" content="Previous"> | ||
<meta name="loc:themeLight" content="Light"> | ||
<meta name="loc:themeDark" content="Dark"> | ||
<meta name="loc:themeAuto" content="Auto"> | ||
<meta name="loc:changeTheme" content="Change theme"> | ||
<meta name="loc:copy" content="Copy"> | ||
<meta name="loc:downloadPdf" content="Download PDF"> | ||
|
||
<script type="module" src="./../public/docfx.min.js"></script> | ||
|
||
<script> | ||
const theme = localStorage.getItem('theme') || 'auto' | ||
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme) | ||
</script> | ||
|
||
</head> | ||
|
||
<body class="tex2jax_ignore" data-layout="" data-yaml-mime=""> | ||
<header class="bg-body border-bottom"> | ||
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation"> | ||
<div class="container-xxl flex-nowrap"> | ||
<a class="navbar-brand" href="../index.html"> | ||
<img id="logo" class="svg" src="../images/fav.png" alt="SOLIDWORKS PDM SDK"> | ||
SOLIDWORKS PDM SDK | ||
</a> | ||
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation"> | ||
<i class="bi bi-three-dots"></i> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navpanel"> | ||
<div id="navbar"> | ||
<form class="search" role="search" id="search"> | ||
<i class="bi bi-search"></i> | ||
<input class="form-control" id="search-query" type="search" disabled="" placeholder="Search" autocomplete="off" aria-label="Search"> | ||
</form> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
</header> | ||
|
||
<main class="container-xxl"> | ||
<div class="toc-offcanvas"> | ||
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel"> | ||
<div class="offcanvas-header"> | ||
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5> | ||
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button> | ||
</div> | ||
<div class="offcanvas-body"> | ||
<nav class="toc" id="toc"></nav> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="content"> | ||
<div class="actionbar"> | ||
<button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents"> | ||
<i class="bi bi-list"></i> | ||
</button> | ||
|
||
<nav id="breadcrumb"></nav> | ||
</div> | ||
|
||
<article data-uid=""> | ||
|
||
|
||
</article> | ||
|
||
<div class="contribution d-print-none"> | ||
<a href="https://github.com/BlueByteSystemsInc/PDMFramework/blob/master/docfx/docs/TaskDetails.md/#L1" class="edit-link">Edit this page</a> | ||
</div> | ||
|
||
<div class="next-article d-print-none border-top" id="nextArticle"></div> | ||
|
||
</div> | ||
|
||
<div class="affix"> | ||
<nav id="affix"></nav> | ||
</div> | ||
</main> | ||
|
||
<div class="container-xxl search-results" id="search-results"></div> | ||
|
||
<footer class="border-top text-secondary"> | ||
<div class="container-xxl"> | ||
<div class="flex-fill"> | ||
<span><a href='https://bluebyte.biz'>Blue Byte Systems Inc</a>. Made with Maple syrup 🍁.</span> | ||
</div> | ||
</div> | ||
</footer> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.