The Global Archicad Community

Stay informed. Get help. Share your knowledge.

Everything about using Libraries and Library Parts - Doors/Windows/Objects/Stairs etc. (Example: How can I display a Transom above my Door?)

Moderators: Karl Ottenstein, LaszloNagy, ejrolon, Barry Kelly, gkmethy, Gergely Feher

By Pertti Pääsky
Hi all Polygon Operation masters.
I tried GDL to Clip a polyline with another polyline but failed, Polyline offset works fine yet. Some other options also failed, please check the attacment.
This function is great, but I can´t get it work.
PolyCut object
(3.17 KiB) Downloaded 12 times
By MADheikki
The problem is that you forgot to differentiate between polylines and polygons. The calls that save them should go something like this:
Code: Select all
PREPAREFUNCTION ch, "StorePolyline", "polyline1", nVertices4,vertArr4,defaultInhEdgeInfo, inhEdgeInfos
dim cont1[]
cont1[1]=vardim1(vertArr)  ! points to the last vertex of the contour
! Store = Store _polygon_
PREPAREFUNCTION ch, "Store", "poly1", nVertices,1,vertArr,cont1 

Similarly you need two versions of "draw respolyarr" - one that draws polylines that OffsetPolyline and ClipPolyline produce (with GetPolylineVertices), and another to draw the polygons that PolyCut and CopyPolygon produce:
Code: Select all
! GetVertices = Get _polygon_ vertices
nVertices = CALLFUNCTION (ch, "GetVertices", polylineID, resPolylineVertices) 
Polygon Operations sure is full of gotchas...