VS:BuildResourceListN2

From Vectorworks Developer
Revision as of 09:27, 29 February 2016 by CBM-c- (talk | contribs) (add example and remark)
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

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 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: active document (only if saved) is not operationa, 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]]