C# SolidWorks API Tutorial - 01 Getting Started Creating Taskpane
Вставка
- Опубліковано 6 вер 2024
- The first of the long awaited SolidWorks API tutorials using C# and the latest code.
This video shows you how to create and register a taskpane add-in ready for you to start your projects on.
Holy moly! I cannot thank you enough for these tutorials! I have been wanting to get into Addin development for Solidworks mainly for my own startup and enhance my very rusty amateur C# skills. But had absolutely no clue how to even get started and Solidworks themselves have such little information out on the web despite me buying a (very expensive) license of their product. I wish Dassault would be more like Autodesk with their approach to putting our documentation and information on the Internet for hobbyists to develop for their damn software.
So, thank you very much and I hope you will make more informative tutorials like these in the future :)
Glad I could help. I'll carry on with the series shortly
thanks bro. been looking this for years! already tried this add succeeded. please make more videos like this. really appreciate your work man.
I am a Chinese student,but there are no such tutorial vedios in my language,I can make progress by watching yours.Thanks for your efforts.
Your welcome. Glad I could help
Great Video. I am a C# developer who has never seen Solidworks - but was assigned the task of creating an add-in for engineers in my office. This should help immensely. Thanks again.
Awesome. This should get you going, then specific help you can also try the SolidWorks API forums too
Thanks a lot Luke. The tutorial is very useful.
If I have two solidworks versions o my machine, how can i choose which interop to load? or should i simply use last version which (i suppose) support back compatibility? or should I have both DLLs for each version? if so, how will I domically load right version? thanks
Hi luk, as always a great tuto thanks,
Is ther a specification for icons, tried to resize, create one withe inkscape (24,32....)but with no chance, any ideas !
Awesome ! Have been looking a long time such a good and easy to follow API tutorial !
A great way to get started. Good explanations of what the code is designed to do as you go along.
I had used the command line registration before you mentioned your installer/uninstaller, the only piece missing was the command line for the de-registration of the add-in.
Glad you like it. Hopefully its useful
regasm /u "[full path to your DLL in double quotes]". Found it on stackoverflow from Erik Oosterwaal
Thanks a lot Luke. May God Bless You.
Thanks for the amazing tutorial...Please give us more of such tutorial.
double like :).
this will definitely inspire many new API programmers
Thanks glad you like it :)
Thank you for the tutorials.
Can you create a tutorial for SolidWorks Document Manager API?
I really appreciate your time and effort, thank u for this great tutorial, you helped me a lot.
Hey Luke,
These tutorials are great. Thank you for creating them.
question: How can I register the addin through an exe instead of manually adding it via the installer.
Andy
Very helpful, thank you for taking the time to do this. It is very much appreciated!
Your welcome
Amazing. Thanks so much!
SW Addin sees but does not launch it. With manual permission through the settings, it simply does not turn on. I do not know what to do. Did it exactly according to the video
Thanks a lot, very useful. I used it as base for my add in. Now I need to open a drawing file and export it in dxf and pdf. Is there anybody who can help me please? Thank you!
Great Video..Will you please post video regarding macro feature creation API's and its behaviour in solidworks..
i have a trouble with my codes. So How can i call Solidworks then macro directly by C# WPF? thanks!
Thanks for this one!
but im having an issue with comregister. not updating my registry (
same code, used regasm /codebase in admin mode. nothing (
cannot get why.
it adds my GUID to registry under classes root, but not adding to SW Addins folder (
found! it adds it to WOW6432Node\SolidWorks. not to main
Console.WriteLine(rk); show right place. but saves to wrong (
my mistake! i wasnt in framework64. now its ok.
hi . i have a probleme with SldWorks type it says that it is a name space and not a class !! any solution ?
This is awesome!
Thank you!!
Thank you so much for your in depth tutorials, you are the man!!! I'm having trouble with the add in UI tho, the add in loads but the UI is frozen and doesn't load the pane in my taskpanehostUI.cs[Design]....plz help this newbie!
Install this marketplace.visualstudio.com/items?itemName=AngelSix.soliddna-blank then just go to File New Project and you can create a SolidDNA template project ready to go
@@AngelSix Ok lemme give that a try, thx Luke!!! I'll def be buyin some merch or donating very soon...Keep up the good work man!
You are an IDOL!
Can i build custom add-in for my own use
Thank you for this nice tutorial!
No problem
Thanks AngelSix for your awesome tutorials.
I have a general question to SolidWorks Addins: It is possible to run methods like SldWorks.OpenDoc6 or ModelDocExtension.SaveAs Asynchronously? (I am using the .Net 4.6.2 )
If you run them in your app in a Task.Run its async to your own UI but not necessarily to SolidWorks own UI thread.
Hi Luke! I'm just staring with Soliworks API, but I've seen that using C# you need to install Solidworks API SDK to have a template in Visual Studio to create Addins, and I'm confused because you don't follow the same path, so with you "Solidworks Add-in installer" is not neccesary install SDK ? Thanks for your tutorials!
The SDK is not needed for this, no. Install SolidDNA templates if you want to create my templates easier marketplace.visualstudio.com/items?itemName=AngelSix.soliddna-blank
TaskpaneHostHUI does not exist. Why?
I get an "unexpected response" error message when I tried to install my dll. Then I tried installing your Blank Add-in file on Github and it installs successfully. What could be causing this??
Awesome, just what I need, are you doing anything else, where do I find it?
i have completed the add task pane but with command prompt i can not add addin can you seend me the link for downloading the solidwprks add in installer
@AngelSix My .Net target framework is set to 2.0. But I'm using Visual Studio2017 and it has .Net framework 4.7 built into it. Why is that? And there is also no Assembly Information button as shown in 2:41
You are targeting .Net Framework 2.0 or .Net Core 2.0? I would target 4.7.2 for Framework
Hello AngleSix...
This is very helpful. So I am currently looking for the Add-in Installer and couldn’t find it the GitHub page.
Please how can I get access to that?
JUST GREAT!!!
Thanks
You are great, thank you bro....!!!
Your welcome
That's bad ass!
Thank you!
Hi,
I want to build Solidworks to PLM connector, can you help me here? I don't have much background of Solidworks, my expertise is PLM customization and webservices. I want to integrate solidworks drawings to PLM. Can you please help me from where I should start? Thanks in advance
Great video mate! I only have one little issue
I got the add-in installed and available in solidworks just fine, but the image doesn't load on the icon on the right task panel, instead solidworks is using a general panel image it seems.
Now, I'm quite new to c# which mean it's definitely 100% my fault, but I can't find what I did wrong. Wondering if you have any clue of what's going on.
I'm using the same image you used btw.
Hi bro, same issue her, did found a solution ?
Hi Luke,
Thanks for your tutorials and hard work. I would hope I have really tried on this years ago.
But after trying for days, I got the same problem - "a project with an output type of class library cannot be started directly."
Is it because I am using visual studio 2022, a different framework (4.7.2), or because of SolidWorks 2018?
Many Thanks
You just have to choose a project that can execute as the start project. Like a console application or a wpf.
@@taco0077 thanks, but it's ok now as long as it goes to property and start as external program - Solidworks exe
It's great.
Actually I'm totally new for programming and coading. I am from mechanical field and I don't know about anything programming. But I would like to learn so what's will be the first stage for starting to learn API
I have 2 free books at www.angelsix.com/solidworks just download the Macros and Files and the books are in there
AngelSix thanks
Hey ! i can't find "bin" directory in your public repository( please help
Just need to open the solution to SolidWorksApi.AddinInstaller and build. "Bin" directory will then be created.
Hello Angel SIx, my code seems to run correctly but my logo and the title and description don´t appear, do you know why?
I don´t have any error during debugging
Can you send me your code to contact@angelsix.com and I'll take a look
thank you so much!
I don't see the bin folder in the zip file on the GitHub repository. I managed to run the program using the Visual Studio project file. When I selected my dll file and clicked install, I get an Unexpected Response window that pops up:
Microsoft.NET Framework Assembly Registration Utility version 4.6.1586.0 for Microsoft.NET Framework version 4.6.1586.0
leeblackharry double check your code and compare it to the github code. if it fails something is mistyped or wrong
I decided to use your code directly from github and renamed some things to reflect what I wanted. I got it to work now. The question that I have is how can I go about modifying the code to make the taskpane load up when I click a custom icon in a menu and have it show on the left side instead of the right? I basically want to make my own SolidWorks tool.
Taskpanes appear in the right that is kind of fixed. You can create a PMP on the left only. A third option is to create your own Windows WPF form that you show, but it wont be pinned inside SolidWorks. Best option is to just accept its on the right. To load it from another button just run a macro from that button I presume you are doing (or you can create a menu item in the add-in directly my next video will show that) then use the SolidWorks API swApp.LoadAddIn call
Is it possible to write a macro to change Font height under Options / Document Properties / Dimensions ?
Yeah I would say so. Simplest thing, go to the menu in SolidWorks and start recording a macro. Then edit that property. Then stop the macro and look at what code it recorded
Awesome
Thanks
Could you show how a .msi file could be made from this? so the end user just installs the Add-in through that. thanks
We will get around to installers but it won't be for a while. We will likely use Wix wixtoolset.org/
unable to register the dll file. do you have the register exe file?
how can i install solidworks addin installer
Awesome!!! Can u make the same tutorial for Creo/ProE
I mainly focus on SolidWorks at the minute put possibly in the future yes
Hi , can you do the same for NxOpen API ? If possible please do using python.
Thank you very much. But, how to read custom properties of assembly. Don't need export file excel.
Just use ActiveModel.UnsafeObject.CustomInfo2
How to save custom properties of assembly on array ?
You can example detail do it.
Thanks.
Thats just normal SolidWorks API stuff, just ask the question on the SolidWorks API forums, I don't have time to do detailed code on comments here. When I get time I do videos on specific topics and help in general on comments
At min 25:50 missing > mTaskpaneView = mSolidworksApplication.createTaskpaneView2....
Luigi Fasano that's done on line 95 above
making the same mistake also. but later found out by myself.
I missed this too. Comments to the rescue!
Great job! Could anyone tell me whether the add-in created by SolidWorks API 2017 can work with SolidWorks 2018 or not and how to load it? I created an add-in using SolidWorks API 2017 and tried to load it on SolidWorks 2018 but nothing happens. Thanks in advance!
Sure it will work. Check out my newer videos you can create add-ins now directly inside Visual Studios "New Project" with my SolidDNA templates
Thank you, bro. It really works. Thanks again!
How to get that reference and related folder at 0:52 sec. Please share link
All the source code is here github.com/angelsix/solidworks-api
AngelSix Thanks. Also for tutorials
Doesn't work for me, I have an issue
I've tried both the Command Promt as administrator and the SolidWorksAddinInstaller I got from your GitHub but I still get the same error message displayed at 38:59
Your file (AngelSix.SolidWorks.BlankAddin) runs just fine. It also has a lot more files in the Debug folder.
I've checked for spelling or other mistakes but I can't find any. Does anyone have an idea as to why this is ? Any help would be appreciated !
Your SOLIDWORKS DLL files set to embed interrop false?
Also do you have rights on the PC to write to registry? Are you an admin?
@@AngelSix Hi ! Thank you for your reply, it's very much aprreciated !
I restarted the project from scratch and set all the SolidWorks.Interop... DLL files in the 'References' section of Visual Studio to embed interrop false.
Good news is that the error message is gone ! I get the "Add-in was succesfully registered" message
Bad news is that the add-in does not show up in SW at all. Neither in the left panel nor in the Tools → Add-Ins Menu
Those I run on the GitHub Tutorial appear withou any issues, so it must be an issue on my end
Just watch later videos I made an extension to VS so you can just create projects from inside VS already setup right
This is amazing! I owe you beer and chips. The official add-in template has a lot of .Net incompatibilities making it unable to run. Your one is of a lot of "handjob", but working and very helpful.
Thanks
thanks
can you share the link to "Solidworks Add-in installer" ??
github.com/angelsix/solidworks-api/tree/develop/Tools/Addin%20Installer
Thanks man :)
Thanks for your videos... Can't describe how it was very helpful to me and others 😊
And I was wondering.. Is there any way to get the wight of the opened part and it's boundaries via add in?
what is solid works?
v harish it's software to design 3D stuff for engineering (not so much graphical design). I do software for them too
Its a CAD software mainly used by Mechanical Engineers to design machines, engineering drawings and structures.
What is Solid Works?
+TomiXo 3D CAD package. I make software for it and mess with their API sometimes
@@AngelSixcan you explain where you set what you future blank will field custom feature of model... can i change this function to anover what will field weldment cut list?
Thanks for this video!