Robot Structural Analysis Forum
Welcome to Autodesk’s Robot Structural Analysis Forums. Share your knowledge, ask questions, and explore popular Robot Structural Analysis topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dimension precision when exporting to Robot using API

16 REPLIES 16
Reply
Message 1 of 17
LuisCRodrigues
1146 Views, 16 Replies

Dimension precision when exporting to Robot using API

I have a macro to export a model from cad to Robot using API.

I would like to know what is the criteria that Robot uses to round the dimensions of elements that came from cad.

I have this doubt because I've noticed that all the dimensions in cad have more decimal places than the dimensions in Robot.

 

Any help will be appreciated.

16 REPLIES 16
Message 2 of 17

you know you can change the number of decimal places under preferences?

 

or, just open the dwg from within Robot

 

tony

Message 3 of 17
Pawel.Pulak
in reply to: tony.ridley

Additional remark related to DXF or DWG import:

When model is imported from DXF or DWG in metric units the coordinates are rounded off to 4 decimals. It results in higher precision when importing in millimeters than when importing in meters.

 

Best regards,

 


Pawel Pulak
Technical Account Specialist
Message 4 of 17

Maybe I was not clear: I'm using Robot API.

 

For example:

If I have a line in cad, my macro reads the coordinates of the end points and creates two nodes in Robot with the same coordinates. Then a bar is created using these two nodes as startnode and endnode.

My problem is that the coordinates that are read in cad have more decimal places than the coordinates that are written in Robot.

 

I need to know how Robot rounds the coordinates that receives using API.

 

 

Message 5 of 17

Take a look below:

 

accuracy.jpg



Rafal Gaweda
Message 6 of 17

Nodes.jpg

 

I obtain a different result.

Do you know why?

Message 7 of 17

Rafal,

Meanwhile, I've made some tests.

I have exported from excel to robot different nodes with different coordinates and I'm getting different results.

 

It's still a mistery (for me) what's the criteria that Robot uses to round the coordinates.

 

Message 8 of 17

Luis
Meanwhile, I've made some tests.

I have exported from excel to robot different nodes with different coordinates and I'm getting different results.

 

It's still a mistery (for me) what's the criteria that Robot uses to round the coordinates.

 

It seems robot reads up to 9 digits after comma (in meters) in API.

I had 10 digits yesterday but I do not know how it happend. Today always 9.



Rafal Gaweda
Message 9 of 17

I'm using Robot 32 bit with Windows XP 32 bit and Windows 7 32 bit.

I don't know if this is important, but the code that I've made for exporting from cad to Robot is used by some users.

Some of them uses Windows 7 64 bit.

 

Message 10 of 17

It seems robot reads up to 9 digits after comma (in meters) in API.

I had 10 digits yesterday but I do not know how it happend. Today always 9.



Rafal Gaweda
Message 11 of 17

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

 

 

Message 12 of 17

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

precision.jpg



Rafal Gaweda
Message 13 of 17

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?

 

 

Message 14 of 17

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
Message 15 of 17
Rafal.Gaweda
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
Message 16 of 17

Hi, Please dont feel offended. I am fresh graduate from India. My request is if  Is it possible for u to share the API that exports from cad to ROBOT then plz share it? 

Message 17 of 17

Similar issue here. Trying to increase precision and get some more digits after the decimal. Changed units in robot to mm. Does not seem to help. Any help is appreciated!

borisscerkasins_0-1623773345960.png

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report