Procedure SetSegPt1 sets the location of the start point of the referenced line or wall object.
PROCEDURE SetSegPt1(
h : HANDLE;
pX,pY : REAL);def vs.SetSegPt1(h, p):
return None| Name | Type | Description |
|---|---|---|
| h | HANDLE | Handle to line. |
| p | REAL | New start point of line. |
Although GetSegPt1 works on linear dimensions this call does not successfully set the pt for a dimension.
PROCEDURE ExtendLine;
CONST
kEXTENSION = 250mm;
PROCEDURE ProcessLine(lineHdl :HANDLE);
VAR
size :REAL;
lineVec :VECTOR;
arrow1,arrow2 :BOOLEAN;
style,angle :INTEGER;
p1X,p1Y,p2X,p2Y,lineLen :REAL;
BEGIN
GetSegPt1(lineHdl, p1X, p1Y);
GetSegPt2(lineHdl, p2X, p2Y);
GetObjArrow(lineHdl, style, size, angle, arrow1, arrow2);
IF arrow1 THEN BEGIN
lineVec[1] := p1X - p2X;
lineVec[2] := p1Y - p2Y;
lineLen := Norm(lineVec);
lineVec := (lineLen + kEXTENSION) * UnitVec(lineVec);
p1X := p2X + lineVec[1];
p1Y := p2Y + lineVec[2];
SetSegPt1(lineHdl, p1X, p1Y);
END ELSE BEGIN
lineVec[1] := p2X - p1X;
lineVec[2] := p2Y - p1Y;
lineLen := Norm(lineVec);
lineVec := (lineLen + kEXTENSION) * UnitVec(lineVec);
p2X := p1X + lineVec[1];
p2Y := p1Y + lineVec[2];
SetSegPt2(lineHdl, p2X, p2Y);
END;
END;
BEGIN
ForEachObject(ProcessLine, (((C='LineClass') & (T=LINE))));
END;
RUN(ExtendLine);VS Functions: SetSegPt2
Availability: from All Versions