Difference between revisions of "VS:SetPenBack"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
(update remark to reflect python)
 
Line 36: Line 36:
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
 
<remark>
 
<remark>
 +
([[User:Orso.b.schmid|Orso]] 2015.05.18): This Vectorscript routine responds to multiple types of notations:
  
 +
Vectorscript:
 +
* Singular [[VS:RGBToColorIndex| color index]]:
 +
*: <code>colorIndex := RGBToColorIndex(65535, 0, 0);</code>
 +
*: <code>SetPenBack(FSActLayer, colorIndex);</code>
 +
* Three RGB longints:
 +
*: <code>SetPenBack(FSActLayer, 65535, 0, 0);</code>
 +
 +
Python:
 +
* Singular color index:
 +
*: <code>vs.SetPenBack(vs.FSActLayer(), vs.RGBToColorIndex(65535, 0, 0)) </code>
 +
* Three longints in a tuple:
 +
*: <code>vs.SetPenBack(vs.FSActLayer(), (65535, 0, 0)) </code>
 +
* Three hex numbers in a tuple:
 +
*: <code>vs.SetPenBack(vs.FSActLayer(), (0xFFFF, 0, 0)) </code>
  
 
+
On Vectorlab there is a list of all color routines accepting multiple variable type, see: [http://www.vectorlab.info/index.php?title=Index_pitfalls#Colors Color Index].
This Procedure will also accept a single INTEGER Color Palette Index value for the COLOR parameter. See similar comment for SetFillBack.
+
; Warning: SetPenBack, SetPenFore will remove the "ByClass" attribute of the FILL as well. Remember to parse for it and restore it.</remark>
 
+
 
+
 
+
SetPenBack, SetPenFore will remove the "ByClass" attribute of the FILL as well. Remember to parse for it and restore it (up to VW 13).</remark>
+
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Latest revision as of 00:34, 19 May 2015

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

Description

Procedure SetPenBack sets the pen background color of the referenced object. RGB values are in the range of 0~65535.
PROCEDURE SetPenBack(
h  :HANDLE;
color  :LONGINT);
def vs.SetPenBack(h, color):
    return None

Parameters

h HANDLE Handle to object.
color LONGINT RGB color value.

Remarks

(Orso 2015.05.18): This Vectorscript routine responds to multiple types of notations:

Vectorscript:

  • Singular color index:
    colorIndex := RGBToColorIndex(65535, 0, 0);
    SetPenBack(FSActLayer, colorIndex);
  • Three RGB longints:
    SetPenBack(FSActLayer, 65535, 0, 0);

Python:

  • Singular color index:
    vs.SetPenBack(vs.FSActLayer(), vs.RGBToColorIndex(65535, 0, 0))
  • Three longints in a tuple:
    vs.SetPenBack(vs.FSActLayer(), (65535, 0, 0))
  • Three hex numbers in a tuple:
    vs.SetPenBack(vs.FSActLayer(), (0xFFFF, 0, 0))

On Vectorlab there is a list of all color routines accepting multiple variable type, see: Color Index.

Warning
SetPenBack, SetPenFore will remove the "ByClass" attribute of the FILL as well. Remember to parse for it and restore it.

Version

Availability: from All Versions

See Also

VS Functions:

VS:RGBToColorIndex | VS:ColorIndexToRGB

VS Functions:

[[VS:RGBToColorIndex]]

| [[VS:ColorIndexToRGB]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox