Discussion Groups

Robot Structural Analysis

Reply
Contributor
LuisCRodrigues
Posts: 21
Registered: ‎03-29-2010

Re: Dimension precision when exporting to Robot using API

02-23-2012 07:18 AM in reply to: Rafal.Gaweda

In my tests, sometimes Robot acepts 9 decimal places, sometimes 6, sometimes 3, ...

 

I've made a table in excel with 20 rows (in column 3).

In the first row I put 123456789123456

In the second row I put 123456789123456 / 10

In the third row I put 123456789123456 / 100

and so on...

In the 20th row I put 123456789123456 / (10^19)

 

Running the code below, 20 nodes are created in Robot and column 4 is filled with the coordinates obtained.

Im' getting some curious results...

 

Dim robapp As irobotapplication
Set robapp = New RobotApplication

Dim X As Double
Dim oNode As IRobotNode
For I = 1 To 20
    X = Cells(3 + I, 3)
    robapp.Project.Structure.Nodes.Create I, X, 0, 0
    Set oNode = robapp.Project.Structure.Nodes.Get(I)
    Cells(3 + I, 4) = oNode.X
Next I

 

 

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,471
Registered: ‎04-26-2010

Re: Dimension precision when exporting to Robot using API

02-23-2012 08:24 AM in reply to: LuisCRodrigues

If you start with reasonable values you will get reasonable results.

precision.jpg



Rafal Gaweda
Please use plain text.
Contributor
LuisCRodrigues
Posts: 21
Registered: ‎03-29-2010

Re: Dimension precision when exporting to Robot using API

02-23-2012 10:41 AM in reply to: Rafal.Gaweda

Rafal,

 

That's true, but something must be missing.

 

I try what you suggest and I get the same result.

Then I went to robot and executed the command "zoom all".

Then I repeated the process in excel and I got different results: the coordinates became with only 5 decimal places.

 

This is something that happened in other situations.

A second exportation to robot, after a "zoom all" command, results in different coordinates. !!!?

 

There must be a clear criteria when robot rounds the coordinates.

Did you got any idea from the Development people?

 

 

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,471
Registered: ‎04-26-2010

Re: Dimension precision when exporting to Robot using API

02-24-2012 03:23 AM in reply to: LuisCRodrigues

Yes, you are right. Zoom all command calculates interal tolerance based on the farthest nodes. 

This tolerance is also used in API.

If you have reasonable coordinates: max hundreds\ thousands of meters then accuracy should be up to 8 digits after comma.

 

In general it is recommended to create model as close as possible to 0,0,0 point not to see strange effects in Robot.



Rafal Gaweda
Please use plain text.
Product Support
Rafal.Gaweda
Posts: 5,471
Registered: ‎04-26-2010

Re: Dimension precision when exporting to Robot using API

02-27-2012 12:23 AM in reply to: Rafal.Gaweda

This should help:

 

Dim rud As RobotUnitData
Set rud = RobApp.Project.Preferences.Units.Get(I_UT_STRUCTURE_DIMENSION)
rud.Precision = 10

RobApp.Project.Preferences.Units.Set I_UT_STRUCTURE_DIMENSION, rud

Dim x As Double
Dim oNode As RobotNode

Dim n As Double
n = 123456789123456#

For I = 1 To 20
RobApp.Project.Structure.Nodes.Create I, n, 0, 0
n = n / 10
Set oNode = RobApp.Project.Structure.Nodes.Get(I)
Cells(I, 1) = oNode.x
Next



Rafal Gaweda
Please use plain text.