VS:SetLS: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
(add remark: missing complex line types)
No edit summary
(One intermediate revision by one other user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
<b>Use [[VS:SetLSN| SetLSN]] instead.</b>
Procedure SetLS sets the linestyle of the referenced object.
Procedure SetLS sets the linestyle of the referenced object.


Line 43: Line 44:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
[[User:Orso.b.schmid|Orso]], 2014.04.08:  This Routine can be considered partly obsolete from VW 2013 (VW 18) since it will ignore complex line types. Use [[VS:SetLS>N| SetLSN]] instead.
([[User:Orso.b.schmid|Orso]], 2014 Apr. 08):  This Routine can be considered partly obsolete from VW 2013 (VW 18) since it will ignore complex line types. Use [[VS:SetLSN| SetLSN]] instead.


[[User:Orso.b.schmid|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.  
([[User:Orso.b.schmid|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 -[[VS:NumDashStyles| NumDashStyles]].
Thus the secure range to be used is: -1 to -[[VS:NumDashStyles| NumDashStyles]].
Line 52: Line 53:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<sample>
<sample>
==== VectorScript ====
<code lang="pas">
<code lang="pas">
PROCEDURE Example;
PROCEDURE Example;
Line 80: Line 82:
{ Assigning none (no pattern) to the object pen. }
{ Assigning none (no pattern) to the object pen. }
SetLS(ObjHandle, 0)</code>
SetLS(ObjHandle, 0)</code>
==== Python ====
<code lang="py">
</code>
</sample>
</sample>



Revision as of 20:55, 11 November 2015

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

Description

Use SetLSN instead.

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