Jump to content
Sam Jones

List of Records in Document

Recommended Posts

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.

Share this post


Link to post

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);

 

Share this post


Link to post

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. 😕

Share this post


Link to post

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...