Jump to content
Richard1

gSDK->ConvertToPolygonN() does not preserve the original

Recommended Posts

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)

Share this post


Link to post

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.

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...