How to correctly export point coordinates to Excel file.

How to correctly export point coordinates to Excel file.

Anonymous
Not applicable
6,179 Views
30 Replies
Message 1 of 31

How to correctly export point coordinates to Excel file.

Anonymous
Not applicable

Hi!!

 

I'm experiencing the following problem. I'd like to export to an Excel file, using DATAEXTRACTION function, the XY positions of the profile below, composed by 10000 points, referring to the coordinate system shown below:

Cattura.PNG

 

The extraction is correctly executed, but the coordinates seems not to refer to the coordinate system shown above. The matrix is composed by many negative Y coordinates and no negative X coordinates...

 

When i try to plot the coordinates in Matlab using POLYSHAPE function, an error message is visualized: "Polyshape has duplicate vertices, intersections, or other inconsistencies that may produce inaccurate or unexpected results. Input data has been modified to create a well-defined polyshape" and the result is the following one: 

Cattura1.PNG

 

Do you know which might be the problem?

 

Thank you!

 

 

0 Likes
6,180 Views
30 Replies
Replies (30)
Message 2 of 31

imadHabash
Mentor
Mentor

Hi,

i see that you have a non world ucs icon , i suggest to make your ucs in world mode , UCS command >> World   then try your dataextraction and see if any changes ?

 

Imad Habash

EESignature

0 Likes
Message 3 of 31

Anonymous
Not applicable

Thank you for your answer. Now the coordinates are positive and negative as i was expecting, but the plot result in Matlab is wrong. If i try to draw it as a set of points the result seems correct: 

Cattura3.PNG

 

But i need to draw it as an "area" so the points must be connected using a function like POLYSHAPE that keeps giving me that error and the result is: 

Cattura4.PNG

 

0 Likes
Message 4 of 31

imadHabash
Mentor
Mentor

you have to know that the way you select your CAD elements while dataextraction is effect your final result . i mean that your coordinates must be in a proper order to get a proper right shape . 

 

 

Imad Habash

EESignature

0 Likes
Message 5 of 31

Anonymous
Not applicable

So, when it asks me to select the part, the way i do it affects the result? Is there a better way to select the points? 

0 Likes
Message 6 of 31

imadHabash
Mentor
Mentor

honestly .. trial and error is the way for success . 

Imad Habash

EESignature

0 Likes
Message 7 of 31

Anonymous
Not applicable

You're right. AutoCAD seems to export points coordinates' in "zig zag" mode as shown below:

Cattura.PNG

I don't really know how to select the points properly to make it know which profile to follow. 

 

0 Likes
Message 8 of 31

devitg
Advisor
Advisor

@Anonymous 

 

For better understanding, and to get further help, please upload such sample.dwg

 

 

0 Likes
Message 9 of 31

Anonymous
Not applicable

I've uploaded two files as examples.

In the dwg files , i have to export the coordinates of the tool points. The export is the xls file. 

 

When i try to plot the coordinates in Matlab with POLYSHAPE, tool profile is wrong. I'm sure that the problem is the order in which AutoCAD export coordinates but i am not able to correct it...

 

0 Likes
Message 10 of 31

devitg
Advisor
Advisor

@Anonymous  I will try it, to get such data. 

 

0 Likes
Message 11 of 31

Anonymous
Not applicable

Ok, thank you! It's not simple, because AutoCAD seems to export coordinates in random mode and when you try to plot them, Matlab tries to link opposite points without logic. I think the goal is to sort the coordinates so that consecutive points are actually geometrically consecutive. 

0 Likes
Message 12 of 31

devitg
Advisor
Advisor

ERASED BY DEVITG

0 Likes
Message 13 of 31

Anonymous
Not applicable

I can't see your answer 🤔

 

The solution is to mantain some way the sequence of points when exporting the coordinates. I was thinking to try drawing a polyline between all points and then exporting the vertices coordinates... Maybe this way an order could be mantained. The problem is that i can't manually draw a polyline between 10 000 points or more. I need something more automatic. 

0 Likes
Message 14 of 31

Anonymous
Not applicable

Hi! 

 

After thousand attempts, I was able to do it as follow: 

1. Manually connect points with a polyline;

2. Using a LISP by this forum that, selecting the polylines, extract their vertex coordinates;

3. I copied the coordinates to Excel and then i've exported them to MATLAB and the result is the following desiderd one with POLYSHAPE.

Cattura.PNG

 

The problem is: the shape is not so correct, because the points are not enough. Increasing that number it's impossible to connect them manually with polyline. I have to find a better way to extract coordinates of those points keeping their order to draw them properly in Matlab. 😓

0 Likes
Message 15 of 31

j.palmeL29YX
Mentor
Mentor

Here a >>video<< how to create a new polyline. While creating the mesh you can (if necessary) decrease the value of "Mesh distance from original faces" to get more vertices in the Polyline (better accuracy).

 

 

 

 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 16 of 31

leeminardi
Mentor
Mentor

I think an important question to ask is why do you need so many points?  What do you plan to do with the shape that it requires that level of detail? 

lee.minardi
0 Likes
Message 17 of 31

Anonymous
Not applicable

I need that level of detail to be able to subtract from the blank area an accurate simulation of the real shape that the tool creates in reality and i'm trying if the best solution is doing it from AutoCAD or Matlab. 

I think now to be able to do that simulation doing a dynamic plot of tool and blank with the following structure. The cycle is done on all time step of the working process with known Delta(time). I've correctly (but in a too difficult way, i have to try another method) exported the tool and blank as matrices composed by points coordinates. Those points will be plotted on the same graph and rototranslated of known quantities and replot and so on. For every step of the cycle i make a subtraction of the two pieces. This is it. 

 

But i have to find a better way to export the points coordinates of tool and blank. 

0 Likes
Message 18 of 31

j.palmeL29YX
Mentor
Mentor

@Anonymous wrote:

 

I was able to do it as follow: 

1. Manually connect points with a polyline;

..

 

The problem is: the shape is not so correct, because the points are not enough. Increasing that number it's impossible to connect them manually with polyline.


 

Did you try what I posted above (Post #15)? Without additional manual effort you can increase the number of points almost at will (you have only to increase the accuracy of the mesh as described above). 

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 19 of 31

Anonymous
Not applicable

No, i saw your video and it seems a very good idea. I'll try soon. I hope that when i export points coordinates in a matrix, after increasing the accuracy, they will mantain their order as they did doing it manually, but i think they will. I'll give you soon a feedback. 

0 Likes
Message 20 of 31

j.palmeL29YX
Mentor
Mentor

@Anonymous wrote:

 

I hope that when i export points coordinates in a matrix, after increasing the accuracy, they will mantain their order as they did doing it manually, 


 

In the video is shown only how to create a polyline with a high number of vertices. As higher the number of vertices as better follows the new polyline the source polyline.

After creating the new polyline you should of course do the steps

2. Using a LISP by this forum that, selecting the polylines, extract their vertex coordinates; [we don't know which LISP]

3. I copied the coordinates to Excel and then i've exported them to MATLAB .

 

This is not shown in the video because I think this is clear  and works for you as desired.

 

Jürgen Palme
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes