Difference between revisions of "VS:BuildResourceListN2"

From Vectorworks Developer
Jump to: navigation, search
(add example and remark)
(add remark about posix paths)
 
Line 46: Line 46:
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------
 
<remark>
 
<remark>
[[User:Orso.b.schmid|Orso]], 2016.02.29:  It can't be used to retrive the resources in the active document. The useDefaultContent variable doesn't make sense to me: it doesn't seem to make any difference.  
+
[[User:Orso.b.schmid|Orso]], 2016.02.29:  It supports also posix paths on mac ("/"). It can't be used to retrive the resources in the active document. The useDefaultContent variable doesn't make sense to me: it doesn't seem to make any difference.  
  
 
Here some usage examples:
 
Here some usage examples:
Line 57: Line 57:
 
list := BuildResourceListN2(resID, path, cnt, FALSE); { chosen document again }
 
list := BuildResourceListN2(resID, path, cnt, FALSE); { chosen document again }
  
list := BuildResourceListN2(resID, GetFPathName, cnt, FALSE); { WARNING: active document (only if saved) is not operationa, it always returns zero }
+
list := BuildResourceListN2(resID, GetFPathName, cnt, FALSE); { WARNING: it always returns zero }
</code></remark>
+
</code>
 +
</remark>
  
 
-----------------------------------------------------------------------------------------------------------
 
-----------------------------------------------------------------------------------------------------------

Latest revision as of 05:32, 29 February 2016

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

Description

Build a resource list from the specified file.
FUNCTION BuildResourceListN2(
TYPE  :INTEGER;
fullPath  :DYNARRAY[] OF CHAR;
VAR numItems  :LONGINT;
useDefaultContent  :BOOLEAN) : LONGINT;
def vs.BuildResourceListN2(type, fullPath, useDefaultContent):
    return (LONGINT, numItems)

Parameters

type INTEGER the type of resource to put in the list
fullPath DYNARRAY[] of CHAR The path to the file that provides the resources.
numItems LONGINT the number of items in the list built
useDefaultContent BOOLEAN determine if the list should contain default content

Remarks

Orso, 2016.02.29: It supports also posix paths on mac ("/"). It can't be used to retrive the resources in the active document. The useDefaultContent variable doesn't make sense to me: it doesn't seem to make any difference.

Here some usage examples:

resID := 127; { wall styles }
pathID := 113; { Wall ~ Slabs folder }
path := Concat(GetFolderPath(pathID), 'Walls~Slabs Styles Metric.vwx'); { pick a file within the shipped default content }

list := BuildResourceListN2(resID, path, cnt, TRUE); { chosen document }
list := BuildResourceListN2(resID, path, cnt, FALSE); { chosen document again }

list := BuildResourceListN2(resID, GetFPathName, cnt, FALSE); { WARNING: it always returns zero }

Version

Availability: from Vectorworks 2014

See Also

VS Functions:

VS:BuildResourceListN | VS:BuildResourceList | VS:BuildResourceList2

VS Functions:

[[VS:BuildResourceListN]] | [[VS:BuildResourceList]]

| [[VS:BuildResourceList2]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox