Returns the indicated resource from the indicated resource list, if the resource is in the current document. Otherwise it returns nil.
FUNCTION GetResourceFromList(
listID : LONGINT;
index : LONGINT): HANDLE;def vs.GetResourceFromList(listID, index):
return HANDLE| Name | Type | Description |
|---|---|---|
| listID | LONGINT | an ID for a resource list created by the BuildResourceList command. |
| index | LONGINT | an index into the list. |
You can check the referenced status of a resource with the object preference 700:
IsReferenced := GetObjectVariableBoolean(handleToResourceDefinition, 700);
{locked/referenced status }BEGIN
IF GetResourceFromList( defConListID, cnt ) = NIL THEN
BEGIN
resourceH := ImportResourceToCurrentFile( defConListID, cnt );
PIOHand := FInSymDef( resourceH );
gSymbolInfo [cnt].shapeName := GetName( GetRecord ( PIOHand, (NumRecords(PIOHand))) );
gSymbolInfo[cnt].deleteMe := TRUE;
gSymbolInfo[cnt].symbolName := GetSDName( resourceH );
BEGIN
hAccessible := GetResourceFromList(currentResourceList,index);
SetName(hAccessible, GetStr5(1));
END;
BEGIN
IF (folderHandle = GetResourceFromList(listID, listItemIter)) THEN
didCreateViewsFolder := FALSE;
END;import vs
# Returns the indicated resource from the indicated resource list, if the
# resource is in the current document.
listID = 1
index = 1
objHandle = vs.GetResourceFromList(listID, index)
if objHandle is not None:
vs.Message('Created object handle: ' + str(objHandle))Availability: from VectorWorks12.0