BobD Posted August 17, 2005 Share Posted August 17, 2005 I need to traverse objects created by my plug-in scripts per layer, get their data, do some calculations and then spit out an ascii file. I have looked at three ways to do this: 1. I have tried the ForEachObject code as shown in the Ref. Manual, and I can get the handles to the objects so I can operate on them within the callback procedure. My question is, how to I access the param data for each object? 2. I created a report but this is a bit cumbersome as it looks like I would have to generate a report for each object/record and output a concatenated file. Is there a way to automate this? 3. I can export a database, but again it looks like I have to select one object at a time. Is there a way to select more than one record at a time? Thanks for any suggestions! Quote Link to comment
ccroft Posted August 18, 2005 Share Posted August 18, 2005 1) See GetRField(h:HANDLE;record:STRING;field :STRING). To get the params of a PIO, record is the name of the PIO, field is the name of the parameter. You would probably run thru the each object,get it's data, do the calcs,load the results into an array,go on to the next and then write your file from the array. This would all be done inside a script. 2) Are you attaching records here? If so you can create a worksheet (report) that lists all the objects and their record data. With the worksheet active, Export Worksheet (menu command) will output a delimited list of all this data. This doesn't require V-script. Your criteria for the report might be "List all objects with 'record name' attached". Column formulas would be ='record name'.'field name'. You could further organize this by having more than one record format and more than one database header. 3) I don't have any experience with "Export Database" and don't really know what it does. I use 2) mostly. Some of the data that goes into the attached record (as opposed to the param record) is read from the PIO's params with GetRField, and shows up nicely in the report. The data can easily be edited on an object by object basis in Object Info Palette. It's more flexible than 1. Also, the scripting for 1 is not insignificant for me. I think that the kind of calculations that you're talking about might decide which route to take. Hope it helps Charles Quote Link to comment
BobD Posted August 18, 2005 Author Share Posted August 18, 2005 Charles - thanks so much for the ideas and insight. I'll munch on them a while, then decide which route to take. Bob 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.