Archicad C++ API
About Archicad add-on development using the C++ API.

[SOLVED] Geometry::Polygon2D to Polygon2DData in AC18?

Anonymous
Not applicable
Hi,
I used following code to convert Geometry::Polygon2D to Geometry::Polygon2DData in AC 17.
 
Geometry::Polygon2D polygon2D; 
Geometry::Polygon2DData polygon2DData; 
polygon2D.Convert(polygon2DData); 


This Convert function is removed.
Any ideas how to do the conversion in AC18?

This is part of the following process:
1. List of VectorImage iterated.
2. Each VectorImage with item_Typ SyHatch is converter using ConvSyHatchToPolygon to Geometry::MultiPolygon2D.
3. MultiPolygon2D(s) are iterated.
4. Each Geometry::Polygon2D in MultiPolygon2D is converted to Geometry::Polygon2DData.
5. An union is made from all Polygon2DData using Geometry::UnifyPolygon2DData.
6. The coordinates are extracted from the union using Polygon2DDataToPolyline

-Matti
2 REPLIES 2
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
Hi Matti,

use Geometry::ConvertPolygon2DToPolygon2DData function to convert Geometry::Polygon2D to Geometry::Polygon2DData in AC 18.
Geometry::Polygon2DData polygon2DData; 
Geometry::InitPolygon2DData (&polygon2DData); 
Geometry::ConvertPolygon2DToPolygon2DData (polygon2DData, polygon2D);

Matti wrote:
4. Each Geometry::Polygon2D in MultiPolygon2D is converted to Geometry::Polygon2DData.
5. An union is made from all Polygon2DData using Geometry::UnifyPolygon2DData.

It could be faster if you use Unify method in MultiPolygon2D before conversions:
4. An union is made from MultiPolygon2D using multiPolygon2D.Unify ()
5. Each Polygon2D in result MultiPolygon2D is converted to Polygon2DData by Geometry::ConvertPolygon2DToPolygon2DData

Regards,
Tibor
Anonymous
Not applicable
Thanks!

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!