GithubHelp home page GithubHelp logo

bluebytesystemsinc / solidworks-pdm-api-sdk Goto Github PK

View Code? Open in Web Editor NEW
19.0 2.0 5.0 11 MB

PDM Professional Add-in Development Framework (Add-ins and task add-ins)

Home Page: https://github.com/BlueByteSystemsInc/SOLIDWORKS-PDM-API-SDK

License: Other

C# 89.39% Smalltalk 3.95% Visual Basic .NET 6.65%
solidworks pdm solidworkspdm solidworksapi cad addins

solidworks-pdm-api-sdk's Introduction

PDMSDK is .NET Library for SOLIDWORKS PDM Pro

Tip

We have a new documentation page that contains a step-by-step guide on getting started as well as extensive API reference. It is accessible here.

What can I Do with PDMSDK?

With PDM SDK, you can develop:

  • SOLIDWORKS PDM add-ins
  • SOLIDWORKS PDM task add-ins

VS Template

Get it from here.

Nuget NuGet version (BlueByte.SOLIDWORKS.PDMProfessional.SDK)

Command-line:

Install-Package BlueByte.SOLIDWORKS.PDMProfessional.PDMSDK

Sample add-in

TestAddIn folder contains a sample copy to clipboard addin.

Support

You can start a ticket on this repo. The best way to get an answer is to ask a question at cadoverflow.com under the PDMFramework group.

solidworks-pdm-api-sdk's People

Contributors

alex-b-bluebyte avatar alex-egorchatov avatar alexegorchatov avatar amenjlili avatar avdynut avatar havendv avatar johnplz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

solidworks-pdm-api-sdk's Issues

Build PDMFramework package to target .NET Framework 4.5.1 - 4.8

Situation:
We're currently only targeting .NET 472. As more and more people start using the framework, we'd probably need to include more builds of PDMFramework for 4.5.1 - 4.8 in our NuGet package.

Issue:
Our current NuGet packaging process uses nupack (vs extension to build nuget packages) which is limited. We need to create a script :

  • Build PDMFramework for the version of .NET, we'd like to support
  • Copy those dlls to lib folder (example 451 dll is copied to lib/net451 and so on) where the nuspec file exists.
  • invoke the nuget pack on the package.nuspec to build the package.

A code review might be warranted because some things we are using for 472 (Tuples) are not available for lower versions of .NET and we need to add some dependencies (Example: Tuples)

Common window and msgbox title

I found myself doing $"{Identity.Name} V{Identity.Version}" a lot in msgbox and window titles. Should probably be a method in the identity struct.

Resolve issue when runtime fails to load assemblies

Situation:
Some references fail to load during runtime. We're currently loading all assemblies into the domain every time the add-in loads.
Task:
Use AssemblyResolve event handler to load assemblies that fail to load.

VSTemplate issue with files under task

TaskLaunch, Run, Setup, SetupButton.cs have a partial class called AddIn. The namespace in those files must match the one in AddIn.cs

We need to drop the ".task" from the namespace from those files.

Does this make sense?

PDM commands visibility ?

Idea: Restrict how commands added to the IEdmCmdMgr5 through MenuAttribute class...

Effects/Consequences: The command manager is called when the user logs into the vault from Explorer or the administrator tool. As a consequence, the add-in will add commands based a set of criteria defined in the command definition (MenuAttribute).

This might be useful because the PDM client will not have to listen to the restricted commands and thus making fewer calls to the OnCmd method. We won't need the IsAdministrator from the Extensions package...

Application: Might be very useful to hide menus that only the administrators (or user with specific permissions) are supposed to see.

Issues/Critical bug: TBD

Suggestions:

Commands visibility can be restricted by:

  • User name. (Include regex)?
  • User id.
  • Users who have certain permissions...

Add load and save task properties from file...

Whenever we are testing a task with a customer, we end up having to load up the add-in then the task and fill in data over and over again.

I think we should have two methods called
LoadTaskPropertiesFromFile()
and
SaveTaskPropertiesFromFile()

That are part of the TaskSetupPage so we can load things easier.

We don't have to add any buttons to the UI, just the methods. I'm not too sure about the buttons if truth be told. It might worthwhile to test adding them...

See this example for the load method and this example the save as.

Binding exception thrown if a task definition is loaded twice

We use the OnDataLoaded method to add bindings to the TaskSetupPage controls. This method can be invoked as many times as the user loading task definitions from LoadSettings. This throws a binding exception and fails the load settings operation.

The default behavior (base behavior) of the OnDataLoaded method should clear all bindings from the TaskSetupPage controls...

VSTemplate: 1.8

  1. Fix [Menu((int)Commands.CommandOne, "Click Me!", 43)] to use the right constructors in both CS and VB Project Templates
  2. Upgrade dependencies to 76 or later
  3. Add callback sample for commands enum when it is support is added to PDMSDK
  4. Add support for a category in the Add New Item window when adding a new page. Right now the PDMTaskPage the filename in the window.
    See
    image

Switch to packgereference

Let's switch to packagereference instead packages.config. We need PDMAddInFramework package to be the highest.

Added license terms and small changes

Can you add the following to the top of all the .cs files:

/*
MIT License

Copyright (c) 2022 Blue Byte Systems Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO >THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL >THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF >CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER >DEALINGS IN THE SOFTWARE.*/

Also, change this required version attribute to be like following (You will nedd to add the namespace):

[RequiredVersion(Year_e.PDM2018, ServicePack_e.SP0)]

Compile vstx file (1.3.1) and tag me here when you are done.

Strong name reference issue

The PDMAddInFramework is signed with StrongKey.pfx file. That means that all of its references must also be signed and have Strong Name property set to True. For some reason, it cannot be done manually for all NuGet packages.
To solve this issue, the NuGet package StrongNamer by Daniel Plaisted needs to be installed.

Add support for TaskSetupPage on TaskDetails

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Documentation: Adding programming guide for new users

Help us complete, proofread, or verify the information in the documentation guide for PDMSDK.

Compiled version: https://bluebytesystemsinc.github.io/SOLIDWORKS-PDM-API-SDK/docs/getting-started.html

Working directory: https://github.com/BlueByteSystemsInc/SOLIDWORKS-PDM-API-SDK/tree/master/docfx/docs

To contribute, please make a pull request by:

  • Editing the content of the markdown files.
  • Adding your own or starting a new one that does not exist.

Request PR to be merged and HTML to be compiled by @AmenJlili

Add tags to VS template

We want to be able to add the following tags: C#, SOLIDWORKS, SOLIDWORKS PDM, Add-in, PDM

See below for visual of tags:

image

AddInBase of another add-in is being triggered

Situation:

  • AddIn X that uses PDMFramework is loaded into the vault.
  • AddIn Y that uses PDMFramework is being tested with unit testing. AddIn is not loaded.
  • Some API call in AddIn Y while debugging would take the debugger to methods in AddInBase in AddIn X.
  • Degraded performance is observed.

Required action:

  • Identity why code in AddIn X is being triggered from debugger of AddIn Y. Potential references issue.

SetStatus2 is resetting the progress bar and the elapsed time in the tasklist the administration tool

Issue:

SetStatus2 uses IEdmTaskInstance::SetStatus. Tasks that use PDMFramework do not have proper elapsed time or progress in the administration tool. After reading this, I noticed that SetStatus is only used to set to change the task status. Any other progress is done through SetProgress.

Solution:

Implement SetProgress to report progress to the user unless when explicitly needing to fail, suspend, resume cancel or complete the task in which case use SetStatus with no message whatsoever.

Create Visual Studio project template

We need to create class library project template for solidworks addins that use PDMFramework

The template should be under VSProjectTemplate folder and have the following structure :

Scripts
Prebuild.bat - This script is referenced in the rebuild event of the project and make sure the embed intro types to false
Task
SetupPages
Settings.cs
SettingsViewModel.cs - Needs to implement INotifyPropertyChanged
TaskRun.cs
TaskLaunch.cs
TaskSetup.cs
TaskSetupButton.cs
AddIn.cs

We also need to create an item template for SetupPages: A UserControl that implement TaskSetupPage

Initiative to create PDMFramework documentation by the community and for the community - We need you!

image

We're looking for good-spirited PDM API developers to help document our framework and in the process provide feedback on ease of use.

I think we can break down the documentation as follow:

  • Technical docs done with sandcastle for Visual Studio. This will require that we complete the xml docs.
  • Technical docs through the wiki page here. I'm too sure if this would be useful.
  • Add more examples to the Example folders.

Fix assembly resolve issue

We're using the following resolver now and making it virtual.

        {
            var Assembly = default(Assembly);
            var thisAssembly = new FileInfo(this.GetType().Assembly.Location);
            var directory = thisAssembly.Directory;




            var nameWithoutExtension = args.Name.Split(',').First();


            Console.WriteLine($"{FileVersionInfo.GetVersionInfo(thisAssembly.FullName).ProductName} - Failed to load {args.Name}");

            var files = directory.GetFiles("*", SearchOption.TopDirectoryOnly);

            if (files != null)
            {
                var dlls = files.ToList().Where(x => x.Extension.ToLower().Contains("interop") == false && x.Extension.ToLower().EndsWith("dll"));
                if (dlls != null)
                {
                    foreach (var dll in dlls)
                    {
                        if (args.Name.ToLower().StartsWith(nameWithoutExtension.ToLower()))
                        {
                            Assembly = System.Reflection.Assembly.Load(AssemblyName.GetAssemblyName(dll.FullName));
                            break;
                        }
                    }
                }

            }


            return Assembly;

        }



Remove all unsigned dependencies

I think it might be wise to have as fewer dependencies as we can.

Right we are using these:


  <package id="BlueByte.SOLIDWORKS.PDMProfessional.Interops" version="2021.0.0" targetFramework="net472" />
  <package id="Microsoft.WindowsAPICodePack-Core" version="1.1.0.2" targetFramework="net472" />
  <package id="Microsoft.WindowsAPICodePack-Shell" version="1.1.0.0" targetFramework="net472" />
  <package id="Newtonsoft.Json" version="13.0.1" targetFramework="net472" />
  <package id="SimpleInjector" version="5.3.2" targetFramework="net472" />
  <package id="StrongNamer" version="0.2.5" targetFramework="net472" />
  1. We're only using Windows API code pack for the common open dialog which I think we can do ourselves.
  2. We can drop use of Newtonsoft.Json in favor of XML serializer from .NET
  3. I don't know what we're going to do with SimpleInjector since I can't a signed version. Since it's under a MIT license, we can safely include it in the source code provided that we update the license terms.

Add a UI after the user clicks on create project to specify admin identity

Template Version 2

@avdynut

We want to be able to create a simple UI in WPF to ask the user for the following information (once they click create) :

  • Name of the add-in - > fill the NameAttribute
  • Description -> Descriptionattribute.
  • Company -> CompanyAttribute.
  • Is Add-In a task ? -> IsTaskAttribute (checkbox)

I'm not sure if we should include these

  • RequiredVersion (this will be two comboboxes one for the year and one for the service) -> RequiredVersionAttribute

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.