Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
C++ API AddFile follow by Item.SetName not working
#1
When I use the API to import a step file into RDK and the following call I use a Item.SetName on the import file item, the rename is not working.

Here is a link to step file causing the problem(not the only one):https://1drv.ms/u/s!AhCCWoYK5qdugpoRyD8F...Q?e=NG5QJP
And a code snippet I use to reproduce the bug.
I notice that if the import file is big enough and that importing it takes some time, RDK seems to just ignore my SetName and name it using the step filename (axisinstead ofToto).
When the step file is small, I don't have this bug.

Thanks,
François.


Code:
RoboDK_API::RoboDK *rdk=new RoboDK_API::RoboDK("",21500,"/NOSPLASH");
if (rdk->Connected()) {
rdk->ShowRoboDK();
QString filename="axis.step";
RoboDK_API::Item new_item=rdk->AddFile(filename);
new_item.setName("Toto");
}


Attached Files Image(s)

#2
This cause another problem too, more critical: when I use the AddFile() using a step file and a robot Item (I want to add a tool for a robot) and then I set the tool pose using:

Code:
Item::setPoseTool()

The pose is not set (probably override by RoboDK itself when the importation is completed) and the default pose of 0,0,200 is set instead. The name of the tool is also the wrong one since it is the same problem as this post originaly.
#3
Are you using the latest version of RoboDK?

I'm unable to reproduce this issue with your axis file using the Python API.
#4
(03-22-2022, 08:28 PM)Albert Wrote:Are you using the latest version of RoboDK?

I'm unable to reproduce this issue with your axis file using the Python API.

Hello Albert,
yes I'm using the latest RoboDK version (5.4.1.22004 64 bits on Windows) and also the latest C++ API.

The problem is that the AddFile() method return me the Item even if the file is not completely imported in RoboDK. So when I use the SetName method on the item received from the method, the file is still importing and I guess the method is not working or RoboDK rename the item after me with the name of the file imported.

Here is a link (https://1drv.ms/v/s!AhCCWoYK5qdugppRgDZo...A?e=sleZqQ) to the video showing what is going on, you can see from the application on the left that all operation regarding RoboDK C++ API are completed (at 27 sec) but RoboDK has only imported 5% of the step file at that point.
#5
今天我们固定这个问题。这个问题是特定的to the C++ API as we did not change the timeout. The latest version is now available on GitHub:
https://github.com/RoboDK/RoboDK-API/

It was actually @Samwho pointed me in the right direction.
#6
(03-24-2022, 08:27 AM)Albert Wrote:今天我们固定这个问题。这个问题是特定的to the C++ API as we did not change the timeout. The latest version is now available on GitHub:
https://github.com/RoboDK/RoboDK-API/

It was actually @Samwho pointed me in the right direction.

The fix worked!
Thanks Albert and Sam,
François
#7
Glad it worked, thanks for pointing that out!
Find useful information about RoboDK and its features by visiting our2022世界杯32强赛程表时间 and by watching tutorials on ourYouTube Channel.




Users browsing this thread:
1 Guest(s)