mstrauss159 Posted February 11 Share Posted February 11 Hi! I am creating a worksheet to list Circuit objects. The worksheet currently lists 'Circuit'.'Number', 'Circuit'.'Src_Dev_Name', and 'Circuit'.'Dst_Dev_Name' properly. I would like to add a column that references a custom record attached to the destination device. The field is 'CPT_fielddevice'.'Mount Group' but entering that formula in the worksheet column header does not return anything, since the CPT_fielddevice record is not attached to the circuit. Is there a way to do this? Quote Link to comment
Vectorworks, Inc Employee Boris Stefanov Posted February 11 Vectorworks, Inc Employee Share Posted February 11 Hello @mstrauss159, If I understood you correctly that you want to get a destination device record by having the circuit, I believe that it is possible to do that with the "eval circuit destination device" worksheet function. For example, in the DB Row, your formula should look something like this: =OBJECTDATA('eval circuit destination device'; 'CustomRecordName'; 'CustomRecordField') I believe that should be it, but if you have any other questions related to this, feel free to ask. 4 Quote Link to comment
mstrauss159 Posted February 12 Author Share Posted February 12 17 hours ago, Boris Stefanov said: Hello @mstrauss159, If I understood you correctly that you want to get a destination device record by having the circuit, I believe that it is possible to do that with the "eval circuit destination device" worksheet function. For example, in the DB Row, your formula should look something like this: =OBJECTDATA('eval circuit destination device'; 'CustomRecordName'; 'CustomRecordField') I believe that should be it, but if you have any other questions related to this, feel free to ask. This did it, I just had to replace the semicolons with commas. Thank you @Boris Stefanov! 1 Quote Link to comment
R_Teunissen Posted April 14 Share Posted April 14 Hi @Boris Stefanov, I was wondering if the same trick could work with exchanging data from a record field attached to a Device, to a record field attached to an Equipment Item. The Devices have the "Device Network Info Record" attached. I also have Equipment Items which have an "Eqp Item Network Record" attached. What I'm trying to do is have the 'Eqp Item Network Info Record'.'IP Address' be filled in by the value in its corresponding 'Device Network Info Record'.'IP Address' I've been toying around with the =OBJECTDATA function, but no luck. Is this possible and if so, could you help me out with the correct syntax? Thanks in advance Quote Link to comment
Vectorworks, Inc Employee Boris Stefanov Posted April 15 Vectorworks, Inc Employee Share Posted April 15 Hi @R_Teunissen, If I understand you correctly, you have a record field from a device, that you want to transfer to an equipment device, which has a different record. I'm not sure if it's possible to fill them automatically by using a worksheet function, but the closest thing I can suggest is having the device IP record field in one column ='Device Network Info Record'.'IP Address' and the equipment IP record field on another column by using the ObjectData function =OBJECTDATA('eval equipment item'; 'Eqp Item Network Info Record'; 'IP Address') and then copy the contents of the first column to the second and this will copy the values to the specified record. The other solution is to create a script that transfers the record values, but I think the first solution might be easier. Quote Link to comment
R_Teunissen Posted April 15 Share Posted April 15 (edited) Hi @Boris Stefanov< I also reached out to other sources of wisdom and Peter Vanderwalle at Design Express Belgium helped me out with a script. He called this "transfer_to_equipment' which is 14 lines of code. In the Data Manager, I was then able to transfer data from 1 data source into the corresponding Equipment Item (based on the Name) The formula is in the screenshot below. While we're on topic: If I have multiple instances of a Device, which are on different Design Layers, would it be possible to synchronize the value of a record Field between these Devices? For instance; the 'Device Network Info Record'.'IP Address' filed is the same with every Device with the same Name, no matter which Design Layer they are on? Edited April 15 by R_Teunissen Quote Link to comment
Vectorworks, Inc Employee Boris Stefanov Posted April 15 Vectorworks, Inc Employee Share Posted April 15 Hi @R_Teunissen, I'm not familiar with the Data Manager, so unfortunately, I won't be able to assist you there. About your question, it may be possible to do this via a script which checks if the device names are the same and copies the record field value to the other devices. The only problems with this are that you have to run the script each time you want to synchronize the values, and the other problem is for example if you have two or more devices with the same name, but different field values, the script must choose which value should be copied to the other devices. Quote Link to comment
Thomas Peters Posted April 17 Share Posted April 17 @R_Teunissen, would you be willing to share the transfer_to_equipitem script please? Quote Link to comment
spettitt Posted April 17 Share Posted April 17 ...wait, we can run scripts in the Data Manager? //*cancels plans for the weekend* 2 Quote Link to comment
R_Teunissen Posted April 19 Share Posted April 19 @Thomas Peters although I did not make this script (that was Peter Vanderwalle @Design Express Belgium), I've pasted a screenshot below: 1 Quote Link to comment
spettitt Posted April 19 Share Posted April 19 2 hours ago, R_Teunissen said: @Thomas Peters although I did not make this script (that was Peter Vanderwalle @Design Express Belgium), I've pasted a screenshot below: That's a useful script, thanks. Lots of my purposes for scripting seem to be scuppered by the fact that the sockets in devices are just copies of the same objects shown in the device profile group, which makes relational scripting outside of the standard ObjectEval functions quite difficult. I was hoping a script in this way might sort it but alas, not yet. 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.