Skip to content

Latest commit

 

History

History
64 lines (53 loc) · 1.97 KB

File metadata and controls

64 lines (53 loc) · 1.97 KB

ImportResourceToCurrentFile

Description

Imports the indicated resource from the specified list to the current file, if it is not already in the current file, and returns the handle to the resource.

FUNCTION ImportResourceToCurrentFile(
				listID : LONGINT;
				index  : LONGINT): HANDLE;
def vs.ImportResourceToCurrentFile(listID, index):
    return HANDLE

Parameters

Name Type Description
listID LONGINT an ID for a resource list created by the BuildResourceList and BuildResourceListN command.
index LONGINT an index into the list.

Examples

WorkingWithResrouceList

ELSE IF shouldUseExisting THEN BEGIN
	IF selSymFolder = GetPluginString(4012) THEN BEGIN { symbol is in a defaults document }
		choiceNum := GetImagePopupSelectedItem(selectSymbol, kSyms);
		IF choiceNum <= defaultListCount THEN
			symHandle := ImportResourceToCurrentFile(defaultListID, choiceNum)
		ELSE
			symHandle := ImportResourceToCurrentFile(defaultListID2, choiceNum-defaultListCount);
		IF symHandle <> NIL THEN
			symName := GetName(symHandle);
		END

BEGIN
h := ImportResourceToCurrentFile(ResourceListID, I);
ImportedMarker1 := TRUE;
END

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 );
if vs.GetObject( strMarkerName ) == None:
	hResult = vs.ImportResourceToCurrentFile( hResourceListID, index )
	bMarkerImported = True

See Also

VS Functions: ImportResToCurFileN | BuildResourceList |BuildResourceListN

Version

Availability: from VectorWorks12.0

Category