VS:GetObjectTags: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
No edit summary |
||
(2 intermediate revisions by the same user not shown) | |||
Line 33: | Line 33: | ||
</line> | </line> | ||
</lineList> | </lineList> | ||
For Python, the returned data is a tuple. A list will not work. | |||
</params> | </params> | ||
Line 39: | Line 40: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample></sample> | <sample> | ||
==== VectorScript ==== | |||
<code lang="pas"> | |||
Procedure Test; | |||
var h :Handle; | |||
a :array[1..2] of string; | |||
Begin | |||
h:=FLayer; | |||
GetObjectTags(h, a); | |||
Message(Date(2,2),' ',a(1),' ',a(2)); | |||
end; | |||
Run(Test);</code> | |||
==== Python ==== | |||
<code lang="py"> | |||
h = vs.FLayer | |||
b,t = vs.GetObjectTags(h) | |||
vs.message(vs.Date(2,2), ' ', t[0], ' ', t[1]) | |||
</code> | |||
sample code by Pat Stanford | |||
</sample> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Latest revision as of 00:53, 13 April 2024
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Lets the user query the list of Tags set on an object such as a Class,Layer or Resource.
FUNCTION GetObjectTags(
objHandle :HANDLE;
VAR outArrTags :ARRAY) : BOOLEAN;
def vs.GetObjectTags(objHandle): return (BOOLEAN, outArrTags)
Parameters
objHandle HANDLE The handle to the object to query Tags from. outArrTags ARRAY The output array of Tags queried from the object.
For Python, the returned data is a tuple. A list will not work.
Example
VectorScript
Procedure Test; var h :Handle; a :array[1..2] of string; Begin h:=FLayer; GetObjectTags(h, a); Message(Date(2,2),' ',a(1),' ',a(2)); end; Run(Test);
Python
h = vs.FLayer b,t = vs.GetObjectTags(h) vs.message(vs.Date(2,2), ' ', t[0], ' ', t[1])
sample code by Pat Stanford
Version
Availability: from Vectorworks 2019