Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 1.78 KB

File metadata and controls

64 lines (53 loc) · 1.78 KB

GetVertNum

Description

Function GetVertNum returns the number of vertices of the referenced polygon or polyline object.

FUNCTION GetVertNum(PolyHd : HANDLE): INTEGER;
def vs.GetVertNum(PolyHd):
    return INTEGER

Parameters

Name Type Description
PolyHd HANDLE Handle to polygon.

Examples

BEGIN
	GetVertexType := -1;
	numberOfVertices := GetVertNum(lineHandle);

{ortogonality of the segments and if it is an Open polygon}
polygons := polygons + 1;
if polygons > 1 then Set2FALSE
else BEGIN
	if GetVertNum( tempH ) <> 4 then Set2FALSE
		else if ispolyclosed(temph) then BEGIN
			GetPolylineVertex( tempH, 1, vec1[1], vec1[2], verttype, arcrad );
			GetPolylineVertex( tempH, 2, vec2[1], vec2[2], verttype, arcrad );
			GetPolylineVertex( tempH, 3, vec3[1], vec3[2], verttype, arcrad );
			vec1 := vec1 - vec2;
			vec3 := vec3 - vec2;

net_cnt := 0;
for cnt1 := 1 to wall_cnt do BEGIN
	IF doGross THEN BEGIN
		h1 := OffsetPolygon(walls[cnt1], -1");
		for cnt2 := GetVertNum(h1) downto 2 do BEGIN
			GetPolyPt(h1, cnt2 - 1, pt1.x, pt1.y);
			GetPolyPt(h1, cnt2,     pt2.x, pt2.y);
			IF Abs(Norm(pt2 - pt1)) < .0625" THEN DelVertex(h1, cnt2);
		END;
import vs

# Function GetVertNum returns the number of vertices of the referenced
# polygon or polyline object.
PolyHd = vs.FSActLayer()  # handle to the first selected object on the active layer

count = vs.GetVertNum(PolyHd)
vs.Message('GetVertNum returned: ' + str(count))

See also in tutorials: 20. Read a Polyline and Build Walls Along Its Path, 25. Geometric Property Extraction Table

Version

Availability: from All Versions

Category