I think you'd have to loop through all objects in the group and store the connection info somewhere. That could look something like this:
Table connectionTable = Table("Test");
connectionTable.setSize(0, 2); connectionTable.setColHeader(1, "From"); connectionTable.setColHeader(2, "To"); int row = 0; forobjecttreeunder(model()) { treenode curNode = a; if(curNode.dataType == DATATYPE_OBJECT) { Object curObject = curNode; for(int i = 1; i <= curObject.outObjects.length; i++) { connectionTable.addRow(); row++; connectionTable[row][1] = curObject.name; connectionTable[row][2] = curObject.outObjects[i].name; } } }
Hi, I have tried your code. There is an error "exception: FlexScript exception: Invalid column number: 1 in <no path> at VIEW:/active/MainPanel/ToolPanel/UserPanel/usertoolbar" when it is executed to:
connectionTable.setColHeader(1, "From");
Do you know how to fix this issue?
To record and recreate connections you can use the Objects() table that describes the model. Here's the scripts to use a global table called 'connections'
Record example:
Table.query("SELECT Object, InObjects FROM Objects() WHERE InObjects IS NOT NULL").cloneTo("connections")
Re-create recorded connections:
Table.query("UPDATE Objects() a INNER JOIN connections b ON b.Object=a.Object SET a.InObjects=b.InObjects");
You should be able to do the same using OutObjects and CenterObjects properties.
You can read more about using SQL with object properties here.
Note that you can also construct models from tables using the INSERT INTO Objects() clause with the relevant property fields - where you include the class or an object to copy from (as described here) .
15 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved