VS:GetActualNameFromResourceList
Jump to navigation
Jump to search
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Returns the actual name of the indicated item in the specified resource list. This call will delete the filename that is appended for resources with same name from different files.
FUNCTION GetActualNameFromResourceList(
listID :LONGINT;
index :LONGINT) : STRING;
def vs.GetActualNameFromResourceList(listID, index): return STRING
Parameters
listID LONGINT an ID for a resouce list created by the BuildResourceList function. index LONGINT an index into the list.
Remarks
To get the display name use GetNameFromResourceList.
Example
VectorScript
{ Create a new hatch and add it to the resource list. } hatchName := 'Hatch-1'; BeginVectorFillN(hatchName, true, false, 0); AddVectorFillLayer(0, 0, 1, 1, .25, -.25, .7, 3, 255); EndVectorFill; newHatch := GetObject(hatchName); index := AddResourceToList(listID, newHatch);
Python
def Example(): #{ Create a new hatch and add it to the resource list. } kHatch = 66 kDefHatchFolder = 105 hatchName = 'Hatch-1' listID, numItems = vs.BuildResourceList(kHatch, kDefHatchFolder, '') vs.BeginVectorFillN(hatchName, True, False, 0) vs.AddVectorFillLayer(0, 0, 1, 1, .25, -.25, .7, 3, 255) vs.EndVectorFill() newHatch = vs.GetObject(hatchName) index = vs.AddResourceToList(listID, newHatch) Example()
Version
Availability: from VectorWorks12.0
See Also
VS Functions:
VS Functions:
[[VS:GetNameFromResourceList]]