Richard1 Posted January 16, 2020 Share Posted January 16, 2020 This function does not return nil on failure (VW2019 SP5.3), instead it seems to be returning the original object. Worse, I have not been able to find any documentation as to which object types are supported by the function. So far I have found that passing it a kLine2D returns the original object, thus the following snippet destroys the original drawing: MCObjectHandle tempPoly = gSDK->ConvertToPolygonN(h, (Boolean) true, 512); DoSomethingWithAPolygon"d(tempPoly); if (tempPoly) { gSDK->DeleteObjectNoNotify(tempPoly); } Fortunately this causes our plugin to crash, so our users have not lost data (yet) Quote Link to comment
Stefan Bender Posted January 16, 2020 Share Posted January 16, 2020 Maybe you can check if h == tempPoly to avoid these crashes. Quote Link to comment
Stefan Bender Posted January 16, 2020 Share Posted January 16, 2020 IIrc we are using the old function (without N) in our code. I think it works fine for polylines, rectangles and arcs. I don't know if we are passing other object types. I'm not sure if it is possible to create polygons with less than 3 vertices. 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.