VS:SetLS: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
(No difference)

Revision as of 14:37, 12 August 2013

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

Description

Procedure SetLS sets the linestyle of the referenced object.

If the value is in the range 0 to 71, the specified fill pattern is applied as the linestyle; a value in the range of -1 to -8 will apply the specified linestyle.

Fill patterns and their associated constants can be found in the VectorScript Appendix.

PROCEDURE SetLS(
h :HANDLE;
ls :INTEGER);
def vs.SetLS(h, ls):
    return None

Parameters

h HANDLE Handle to object.
ls INTEGER Linestyle to apply to object.

Remarks

Orso (2011.05.19): Since VW 2010 the max number of Dash styles increased to 128, thus the limit is now theoretically -128 and not -8. It is to be minded that the function will rise a warning if the dash style index passed doesn't exist. This can happen when users deleted them.

Thus the secure range to be used is: -1 to - NumDashStyles.

Example

PROCEDURE Example;
VAR
    cnt :INTEGER;
BEGIN
    PushAttrs;

    TextSize(1);
    TextJust(3);
    TextVerticalAlign(3);

    FOR cnt := -10 TO 71 DO BEGIN
        TextOrigin(-2, cnt);
        CreateText(Concat(cnt));
        MoveTo(0, cnt);
        LineTo(24", cnt);

        SetLS(LNewObj, cnt);
    END;

    PopAttrs;
END;
RUN(Example);


{ Assigning none (no pattern) to the object pen. }
SetLS(ObjHandle, 0)

Version

Availability: from All Versions, deprecated from Vectorworks 2013

See Also

SetLSN from Vectorworks 2013

[[VS:SetLSN|SetLSN]] from Vectorworks 2013