Do I have to manually drag and use 100 beds(3D objects) in FlexSim, or can I create 100 beds through code or other methods?
First drag-drop a bed in the model. Then use the treenode.copy() method to create 100 beds. If you save the locations of the bed in the global table you can set their locations to the defined locations in the table using object.setLocation() method.
Here's a sample code
Object Bed = Model.find("Bed1"); // Manually Created Bed int NumBeds = 100; string TableName = "GloablTable"; Table LocationTable = Table(TableName); for(int i=1;i<=NumBeds;i++) { Object NewBed = Bed.copy(); // Creating new bed NewBed.name =LocationTable[i][1]; NewBed.setLocation(LocationTable[i][2],LocationTable[i][3],LocationTable[i][4])//setting locations }
Creating directly from the library using code is not loading the 3d shape of the bed - can be a bug. That's the reason first manually drag-drop a bed and then use the code abovementioned code in the scrip console to create the objects.
The SQL query method using INSERT INTO also not loading the 3dshape of the bed after creation.
13 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