VS:SetLW

From Vectorworks Developer
Revision as of 10:37, 12 August 2013 by Root (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

Description

Procedure SetLW sets the line weight of the referenced object.
PROCEDURE SetLW(
h  :HANDLE;
lw  :INTEGER);
def vs.SetLW(h, lw):
    return None

Parameters

h HANDLE Handle to object
lw INTEGER Line weight to be applied to object (in mils).

Remarks

If you pass in the handle to a group, the objects within the group do not pickup the lineweight attribute. Compare this to the SetPenFore() procedure in which the objects within the group do pickup the colour attribute.

Example

VectorScript

SetLW(ObjHd,12);

Better example:

PROCEDURE LineWeightChange; 
{ (c) Petri Sakkinen 2008 }
CONST { substitute these with the required values }
oldWeight = 2; 
newWeight = 20;

PROCEDURE ChangeIt (h : HANDLE);
BEGIN 
SETLW(h, newWeight);
END; 

BEGIN
FOREACHOBJECT(ChangeIt, LW = oldWeight);
END; 

RUN(LineWeightChange);

And another example, from Pat Stanford:

PROCEDURE LW_Change;

{Set the FromLW and ToLW constants to the line weights (in mm)}

{That you want changed from and to}

{Vectorscript only handles lineweights in mils, so some trial } 
{and error may be required to determine the correct settings  } 
{March 13, 2008} {(c) 2008, Coviana, Inc - Pat Stanford pat@coviana.com} 
{Licensed under the GNU Lesser General Public License}

CONST
FromLW = 0.05;
ToLW = 0.07;

VAR
VFromLW, VToLW:INTEGER;

PROCEDURE ChangeLW(H1:HANDLE);
BEGIN
IF GetLW(H1)=VFromLW THEN SetLW(H1,VToLW);
END;

BEGIN
VFromLW := FromLW / 25.4 * 1000;
VToLW := ToLW / 25.4 * 1000;
{You may want to change the criteria on the next line if you }
{Don't want PIOs and Viewports to change}
ForEachObject(ChangeLW,(INSYMBOL & INOBJECT & INVIEWPORT & (ALL))); 
END;

RUN(LW_Change);

Python


Version

Availability: from All Versions
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox