Skip to content

Commit

Permalink
added files
Browse files Browse the repository at this point in the history
  • Loading branch information
AmenJlili committed May 16, 2024
1 parent a51f613 commit 4ecf1cb
Show file tree
Hide file tree
Showing 11 changed files with 612 additions and 5 deletions.
Empty file added docfx/docs/TaskDetails.md
Empty file.
3 changes: 2 additions & 1 deletion docfx/docs/TaskSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ To add an EdmTaskSetup:
In the OnCmd implementation:

- Create instances of your task pages.
- Set the [Container](../api/BlueByte.SOLIDWORKS.PDMProfessional.SDK.Core.TaskPage-1.html#BlueByte_SOLIDWORKS_PDMProfessional_SDK_Core_TaskPage_1_Container) property in the EdmTaskPage to that of the AddInBase. We're passing the Container from the AddInBase to the EdmTaskPage.
- Set the [Container](../api/BlueByte.SOLIDWORKS.PDMProfessional.SDK.Core.TaskPage-1.html#BlueByte_SOLIDWORKS_PDMProfessional_SDK_Core_TaskPage_1_Container) property in the EdmTaskPage to that of the AddInBase. We're passing the Container from the AddInBase to the EdmTaskPage.
- Set the Name property of the EdmTaskPage. You can also do this in the constructor.
- Call the method [AddTaskSetupPages](../api/BlueByte.SOLIDWORKS.PDMProfessional.SDK.AddInBase.html#BlueByte_SOLIDWORKS_PDMProfessional_SDK_AddInBase_AddTaskSetupPages_BlueByte_SOLIDWORKS_PDMProfessional_SDK_Core_ITaskPage___) and supply it with an array of your task pages.


Expand Down
170 changes: 170 additions & 0 deletions docfx/docs/TaskSetupButton.md
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.
1 change: 1 addition & 0 deletions docfx/docs/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- name: Add controls and binding to View Model
href: binding.md
- name: TaskSetupButton
href: TaskSetupButton.md
- name: TaskLaunch
href: TaskLaunch.md
- name: TaskRun
Expand Down
115 changes: 115 additions & 0 deletions docs/docs/TaskDetails.html
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 &quot;{query}&quot;">
<meta name="loc:searchNoResults" content="No results for &quot;{query}&quot;">
<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>
1 change: 1 addition & 0 deletions docs/docs/TaskSetup.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ <h1 id="adding-a-new-task-page">Adding a new task page</h1>
<ul>
<li>Create instances of your task pages.</li>
<li>Set the <a href="../api/BlueByte.SOLIDWORKS.PDMProfessional.SDK.Core.TaskPage-1.html#BlueByte_SOLIDWORKS_PDMProfessional_SDK_Core_TaskPage_1_Container">Container</a> property in the EdmTaskPage to that of the AddInBase. We're passing the Container from the AddInBase to the EdmTaskPage.</li>
<li>Set the Name property of the EdmTaskPage. You can also do this in the constructor.</li>
<li>Call the method <a href="../api/BlueByte.SOLIDWORKS.PDMProfessional.SDK.AddInBase.html#BlueByte_SOLIDWORKS_PDMProfessional_SDK_AddInBase_AddTaskSetupPages_BlueByte_SOLIDWORKS_PDMProfessional_SDK_Core_ITaskPage___">AddTaskSetupPages</a> and supply it with an array of your task pages.</li>
</ul>
<h1 id="saving-task-pages-data">Saving task page's data</h1>
Expand Down
Loading

0 comments on commit 4ecf1cb

Please sign in to comment.