VS:SetSegPt1

From Vectorworks Developer
Revision as of 14:38, 12 August 2013 by Root (talk | contribs) (1 revision)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

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

Parameters

h HANDLE Handle to line.
p REAL New start point of line.

Remarks

Although GetSegPt1 works on linear dimensions this call does not successfully set the pt for a dimension.

Example

VectorScript

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);

Python


Version

Availability: from All Versions

See Also

VS Functions:

VS:SetSegPt2

VS Functions: [[VS:SetSegPt2]]