Does anybody know how to extract the coordinates for the points in a polyline?
Does anybody know how to extract the coordinates for the points in a polyline?
(OP)
I'm trying to write a macro that can create a coordinate table for all the points making up a polyline. So far I've been able to export the coordinates of ordinary points to Excel.
However, polylines have proven difficult.
I found code for the polyline.getElement method, but how is the result stored? Array, variable...?
Dim HybShpPolylineElement As Reference
Dim HybShpPolylineRadius As Reference
HybShpPolyline.GetElement 1, HybShpPolylineElement,HybShpPolylineRadius
I'm a beginner when it comes to vba for Catia so I'm at a loss here.
However, polylines have proven difficult.
I found code for the polyline.getElement method, but how is the result stored? Array, variable...?
Dim HybShpPolylineElement As Reference
Dim HybShpPolylineRadius As Reference
HybShpPolyline.GetElement 1, HybShpPolylineElement,HybShpPolylineRadius
I'm a beginner when it comes to vba for Catia so I'm at a loss here.





RE: Does anybody know how to extract the coordinates for the points in a polyline?
Can you give more details and eventually a sample part? Polyline in drawing 2D or 3D space?
You have a polyline and want to extract the points? You can try also to Disassemble the polyline and read the end points of each curve...
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...
RE: Does anybody know how to extract the coordinates for the points in a polyline?
The problem is that I can't find out how the "GetElement" method should present the data when there are multiple variables in the method. Everything else works fine.
The goal is simply to create a table with coordinates and radiues for each point in the polyline.
Code below, problem area marked in red.
CODE --> CATscript
RE: Does anybody know how to extract the coordinates for the points in a polyline?
CODE --> vba
Dim pointRef As Reference Dim pointRad As Length polyline1.GetElement i, pointRef, pointRadbut you still have other errors
indocti discant et ament meminisse periti
RE: Does anybody know how to extract the coordinates for the points in a polyline?
CODE --> vba
indocti discant et ament meminisse periti
RE: Does anybody know how to extract the coordinates for the points in a polyline?
This worked perfectly. I was even able to add length measurement of the polyline aswell.
Awsome, thanks.
Btw, does this forum have a "collection thread" for macros/ functions like this?
I guess alot of people could benefit from the soulutions that are created here.
RE: Does anybody know how to extract the coordinates for the points in a polyline?
Check this thread.
Regards
Fernando
https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...