Sam Jones Posted March 17 Share Posted March 17 I don't seem to be able to create a symbol folder in the resource manager and then import symbols and place them in that created folder all in the same command. The command below creates the folder and then imports the symbols but then places them outside of the created folder. Is there a way to do this? As always TIA. {====================================================================} PROCEDURE LoadTentSymbols; {$DEBUG} CONST kRETentSymbolFolder = 'RE Tent Structure Symbols'; {Resource Manager Folder} VAR RESymbolFilePath :STRING; TentSymListIDX :LONGINT; TentSymListCt :LONGINT; TentSymName :STRING; TentSymHdl :HANDLE; TentSymFolder :HANDLE; Index :LONGINT; {=================================================================} FUNCTION ImportCallBack(VAR resName:DYNARRAY OF CHAR) : INTEGER; BEGIN ImportCallBack := 0; END; {=================================================================} BEGIN RESymbolFilePath := 'Raging Empire'; TentSymListIDX := BuildResourceList(16, -13, RESymbolFilePath, TentSymListCt); TentSymListCt := ResourceListSize(TentSymListIDX); TentSymFolder := GetObject(kRETentSymbolFolder); IF (TentSymFolder = NIL) THEN BEGIN NameObject(kRETentSymbolFolder); BeginFolderN(16); EndFolder; TentSymFolder := LNewObj; ResetObject(TentSymFolder); END; FOR Index := 1 TO TentSymListCt DO BEGIN TentSymName := GetActualNameFromResourceList(TentSymListIDX,index); TentSymHdl := ImportResToCurFileN(TentSymListIDX, index, ImportCallBack); InsertSymbolInFolder(TentSymFolder,TentSymHdl); END; {FOR Index := 1 TO TentSymListCt} END; RUN(LoadTentSymbols); Quote Link to comment
Jesse Cogswell Posted March 18 Share Posted March 18 I think the reason your script isn't working is that you are using LNewObj to get a handle to your symbol folder. The handle to the newly created symbol folder won't be returned with LNewObj since the folder is not something created on a design layer. Instead, use TentSymFolder := GetObject(kRETentSymbolFolder) for the handle. Then it should work (at least it worked in a simplified version of your script where I didn't also import symbols from another drawing). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.