CodeGier Posted February 15, 2012 Share Posted February 15, 2012 Hello, I am working on the 2D look of a 3D path PIO using this function to convert a Nurbs into a polyline: FUNCTION Nurbs2Poly(aPathHD : HANDLE; aPos : REAL) : HANDLE; VAR h : Handle; BEGIN h := CreateOffsetNurbsObjectHandle(aPathHD, aPos); Nurbs2Poly := MakePolyline(h); DelObject(h); END; It works, but in VW2012 the polyline is closed. I do need an open one! Same behaviour with MakePoly the polygon is closed too. I tried to use OpenPoly with my code, but it didn't work either. Any idea how I get an open polyline (or polygon) out of my code? Thanks in advance. Josef Quote Link to comment
Miguel Barrera Posted February 15, 2012 Share Posted February 15, 2012 There are 2 ways you can have a closed poly: 1. The first and last vertex are at the same coordinates. 2. The last segment has its visibility turned on. Depending on which case you have, the options for each are: 1. Just delete the last vertex with: DelVertex(objectHd:HANDLE; vertexNum:INTEGER); and then do #2 also if still closed. 2. Turn off the last segment with: SetPolyClosed(polyHandle:HANDLE; isClosed:BOOLEAN); or SetVertexVisibility(h:HANDLE; vertnum:INTEGER; vis:BOOLEAN); you may also need to set the fill to 0 (unfilled) for a line string look Quote Link to comment
CodeGier Posted February 15, 2012 Author Share Posted February 15, 2012 Hello Miguel, I used SetPolyClosed(polyHandle:HANDLE; isClosed:BOOLEAN); and it worked. Didn't find that in the function reference. Is it undocumented or new in 2012 (or am I unable to find it)? Thanks for sharing that. Josef Quote Link to comment
Miguel Barrera Posted February 15, 2012 Share Posted February 15, 2012 It is in the online function reference http://developer.vectorworks.net/index.php?title=VS:SetPolyClosed 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.