VS:SetLS

From Vectorworks Developer
Revision as of 06:17, 27 April 2014 by CBM-c- (talk | contribs) (typo, date format remark)
Jump to navigation Jump to search

.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, 2014 Apr. 08): This Routine can be considered partly obsolete from VW 2013 (VW 18) since it will ignore complex line types. Use SetLSN instead.

(Orso, 2011 May 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

VectorScript

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)

Python


Version

Availability: from All Versions, deprecated from Vectorworks 2013

See Also

SetLSN from Vectorworks 2013

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