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.
you know you can change the number of decimal places under preferences?
or, just open the dwg from within Robot
tony
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,
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.
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.
LuisMeanwhile, 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.
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.
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.
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
If you start with reasonable values you will get reasonable results.
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?
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.
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
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?
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!
Can't find what you're looking for? Ask the community or share your knowledge.