API refresh load table

API refresh load table

Anonymous
Not applicable
1,334 Views
6 Replies
Message 1 of 7

API refresh load table

Anonymous
Not applicable

I wrote script to create, modify and delete bar loads via API. The problem is that when load has been deleted the corresponding row in load table does not disappear. If new loads are added via API, these empty rows will be filled and this will cause some problems to my API script.

 

I would like to know if there is some piece of code that will refresh load table and remove all empy row from load table.

 

 

LoadTableEmptyRows.PNG

0 Likes
Accepted solutions (1)
1,335 Views
6 Replies
Replies (6)
Message 2 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support
Close the table before deleting records or afterwards close it and reopen


Rafal Gaweda
0 Likes
Message 3 of 7

Anonymous
Not applicable

Is it possible to close and reopen load table via API? I would like give some kind of refreshing command to Robot via API.

 

I noticed that empty rows will disappear if I close and reopen load table. My problem is that, when I add new loads via API, these new loads will be located to these empty rows in load table instead of the end of the load table. Thus indices of these loads will be smaller than some old loads, that locates in the end of the load table. Because of that, I cannot assume that index of new load would be the largest index of load records. This leads to some kind of problems in my script.

0 Likes
Message 4 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support
Accepted solution
Dim t As RobotTable
'open table
Set t = RobApp.Project.ViewMngr.CreateTable(I_TT_LOADS, I_TDT_DEFAULT)
'close table
t.Window.SendMessage 16, 0, 0


Rafal Gaweda
Message 5 of 7

Anonymous
Not applicable

Thanks Rafal! This code creates Load table and then close it. Unfortunately this refreshing of load table won't affect to indices of load records. Indices of load records that have been deleted are not removed.

 

However, I figured out some other way to avoid this index problem of load records.

0 Likes
Message 6 of 7

anacffaria
Enthusiast
Enthusiast

Hello @Rafal.Gaweda 

Can you kindly explain how to open the Quantity Survey table using that method?

Many thanks!

0 Likes
Message 7 of 7

Rafal.Gaweda
Autodesk Support
Autodesk Support

Hi @anacffaria 

 

Example code:

Dim RobApp As RobotApplication
Set RobApp = New RobotApplication
Dim t As RobotTable

Set t = RobApp.Project.ViewMngr.CreateTable(I_TT_MEASURE, I_TDT_VALUES)

 



Rafal Gaweda
0 Likes