Sam Jones Posted January 12, 2021 Share Posted January 12, 2021 Is there a way to retrieve a list of records in the document. If I have nothing selected, there is a list of records in the Data pane of the th OIP, but I don't see any thing like FRecord from where I can start to build a list of records with NextObject(). It would be a real shame to have to query every object to see if it has a record. Quote Link to comment
Peter Vandewalle Posted January 12, 2021 Share Posted January 12, 2021 BuildResourceList should do the trick. I don’t know the type number by heart but you’ll find it in the developers site appendix... Quote Link to comment
Jesse Cogswell Posted January 13, 2021 Share Posted January 13, 2021 Peter is quite correct in that BuildResourceList will do the trick. 47 appears to be the Object Type for Record Formats. The one downside is that it will list the records for all plug-in objects in the drawing as well as the Record Formats in the Resource Manager, which can become a bit much if you have a lot of plug-in objects or different types in a drawing. Sample code I used to test is below. PROCEDURE GetRecordList; VAR recList,numRecords:LONGINT; i:INTEGER; test:STRING; BEGIN recList:=BuildResourceList(47,0,'',numRecords); FOR i:= 1 TO numRecords DO BEGIN test:=Concat(test,' | ',GetActualNameFromResourceList(recList,i)); END; Message('Num Records: ',numRecords,' ',test); END; Run(GetRecordList); Quote Link to comment
Sam Jones Posted January 13, 2021 Author Share Posted January 13, 2021 Thank you Jesse. I didn't read the function reference carefully enough, and missed that "0" would yield just the document resources. Not the first time for that. 😕 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.