VS:SetLW

From Vectorworks Developer
Revision as of 14:37, 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 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