DomC Posted February 8, 2023 Share Posted February 8, 2023 Hi Did not find some hints in the forum, so a deside to make a new post. I think I am doing something the wrong way. But What I want to do is, to grab directly data of a polyline with arcs and radius without converting them or decomposing them. So the GetPolylineVertex command looks like the right workflow for this. But what I can see (depended how the polyline is created or which tools are used to modify it) it returns the radius not directly on the returned point index. The only pattern I can see is, that the last radius which was returned before the vertex point is the right radius. I can imagine, that this workes as designed to bequest the value to the next value which is 0. But somehow not logical is, that other points which are type 0 (edge) contains the radius value. Someone see behind the scene here? polylinie.vwx Quote Link to comment
DomC Posted February 8, 2023 Author Share Posted February 8, 2023 (edited) I think I found it vs.GetPolylineArcMaxRadius(hPoly, vertexNum) Just to close question .Correction in the loop by return 0 if Vertex Type is not Radius or Arc. Also harmonized units, this function returns mm (which is in my opinion very progressive if everything would returns mm and not document units > just a thought but how many code would fail after such an update :-). So good just new things returns mm. However here my little fiddle obj = vs.FSActLayer() num = vs.GetVertNum(obj) units = vs.GetPrefReal(150) output = [] for i in range(1, num + 1 ): p, vertexType, arcRadius = vs.GetPolylineVertex(obj, i) if vertexType in [3,4]: arcRadius = vs.GetPolylineArcMaxRadius(obj, i) / units else: arcRadius = 0 res = p, vertexType, arcRadius output.append(res) vs.CreateText('\r'.join(map(str, output))) Edited February 8, 2023 by DomC Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.