VS:BuildResourceListN2: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
(add remark about posix paths)
(One intermediate revision by the same user not shown)
Line 45: Line 45:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark></remark>
<remark>
[[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:
<code lang="vs">
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 }
</code>
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------

Revision as of 09: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]]