Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

RoboDK.cs C# API documentation

#1
I am trying to connect a Unity application with RoboDK using the C# API.

I saw that there are two versions of the RoboDK C# API available. The nuget version, which installs the API via RoboDKApi.dll file and the single file version, which installs the API via a file called RoboDK.cs. I tried installing both versions in my Unity project individually, but I have different problems with both of them. 

I read that the single file RoboDK.cs version was outdated and it is recommendet to use the nuget version instead. The problem here ist that the nuget version is not available for .NET Standard, which I would need for a Unity Project. Trying to install the available .NET 6 .NET Core 3.1 and .NET Framework 4.5 versions didn`t work, which is because of compatibility issues I think. 

Therefore I tried to use the single file version which I could install in the Unity Project. On the RoboDK GitHub website for the C# API it states that the naming for the single file version is Python-based and links to the documentation https://robodk.com/doc/en/PythonAPI/robo...obolink-py . However I noticed some inconsistencies. For example the documentation includes the functions Pose_2_TxyzRxyz() and TxyzRxyz_2_Pose() which the RoboDK.cs doesnt include. Another example is that RoboDK.cs includes the getItem() function which I cant find in the documentation. These are just examples, the documentation doesnt quite match in general. 

Is there a nuget version available with .NET Standard? 
Is there a documentation which matches the single file RoboDK.cs API?
#2
When using the one file version of the RoboDK.cs API in C#, The TxyzRxyz_2_Pose and Pose_2_TxyzRxyz functions are part of the Mat class and called Mat.FromTxyzRxyz and Mat.ToTxyzRxyz respectively:
https://github.com/RoboDK/RoboDK-API/blo...DK.cs#L577

You can also build your own version of the RoboDK Nuget package by running the nuget_update BAT script:
https://github.com/RoboDK/RoboDK-API/blo...update.bat

You may need to customize the RoboDkApi.nuspec file for your needs and correct .NET target:
https://github.com/RoboDK/RoboDK-API/blo...Api.nuspec

By default we include the .NET Framework 4.5, 6.0 and .NET Core 3.1.
#3
Thank you for your quick reply!

(07-22-2024, 11:03 AM)Albert Wrote: When using the one file version of the RoboDK.cs API in C#, The TxyzRxyz_2_Pose and Pose_2_TxyzRxyz functions are part of the Mat class and called Mat.FromTxyzRxyz and Mat.ToTxyzRxyz respectively:
https://github.com/RoboDK/RoboDK-API/blo...DK.cs#L577
I noticed the other functions by looking at the code. I was just wondering if there is also a documentation like for the Python or nuget C# version.


(07-22-2024, 11:03 AM)Albert Wrote: You can also build your own version of the RoboDK Nuget package by running the nuget_update BAT script:
https://github.com/RoboDK/RoboDK-API/blo...update.bat

You may need to customize the RoboDkApi.nuspec file for your needs and correct .NET target:
https://github.com/RoboDK/RoboDK-API/blo...Api.nuspec
I added the target framework "netstandard2.1" to the RoboDkApi.nuspec file. Running the nuget_update BAT script did create a new .nuget file but it didn`t contain a .dll file, which I need to copy into my Unity Project.
#4
Thank you for your feedback.

Yes, you can find the RoboDK API documentation for C# in the following link:
https://robodk.com/doc/en/CsAPI/api/index.html

This is based on the RoboDK Nuget package.
  




Users browsing this thread:
1 Guest(s)