The following example models were demonstrated at the Autodesk University presentation Elevating Factory Design: FlexSim and the Future of Autodesk Fusion Digital Factory. Refer to that presentation for a demo of these models and additional discussion regarding the topics demonstrated by these examples.
These examples require the Autodesk Interop FlexSim Module.
Using the new AutoCAD FlexScript API, the data within dwg files can be read using FlexScript to automatically build simulation objects within the model.
The script in this Healthcare example is contained in the AutoBuildFromDwg() user command in the Toolbox. This command reads the average location of blocks on the Bed Layer to create Bed Location objects. It also reads the lines on the Wall Layer to automatically create Wall objects and connect them to the A* Navigator for automatic pathfinding around the walls.
string filePath = param(1); AutoCAD.Database db = AutoCAD.Database(filePath); if (!db) return -1; var iter = db.getBlockTable().getAt("*MODEL_SPACE").newIterator(); for (iter.start(); !iter.done(); iter.step()) { var ent = iter.getEntity(); print("Entity:", ent.layer, ent.objectType); if (ent.layer == "Bed Layer") { if (ent.is(AutoCAD.Polyline)) { AutoCAD.Polyline polyline = ent.as(AutoCAD.Polyline); } } }
treenode bedConfig = library().find("/people/Objects/Location>behaviour/eventfunctions/configs/Bed"); Object obj = Object.create("People::Location"); function_s(obj, "changeShape", bedConfig);
Object walls = Model.find("Walls"); if (walls) walls.destroy(); walls = Object.create("People::Walls"); treenode wallsSurrogate = walls.find(">visual/drawsurrogate"); Object libraryPillar = node("/?Pillar", library()); Object newPillar1 = createinstance(libraryPillar, wallsSurrogate); newPillar1.setLocation(0.0, 0.0, 0.0); Object newPillar2 = createinstance(libraryPillar, wallsSurrogate); newPillar2.setLocation(10.0, 0.0, 0.0); function_s(walls, "addWall", newPillar1, newPillar2);
Object walls = Model.find("Walls"); Object aStarNavigator = model().find("AStarNavigator"); if (!aStarNavigator) { aStarNavigator = createinstance(library().find("?AStarNavigator"), model()); } Object grid = aStarNavigator.find("Grid1"); if (!grid) { grid = function_s(aStarNavigator, "createGrid", 0, 0, 0, 1, 1, 0); grid.name = "Grid1"; } contextdragconnection(grid, walls, "A");
POC_OHT_3_MoveOHB.dwg (If this file is named differently when you download it from Answers, make sure you name it back to this exact name. It is referenced by name in the model.)
The script in this AGV example is contained in the interopAutoCAD() user command in the Toolbox. This command reads the location and names of particular dynamic blocks in the dwg file in order to automatically create AGV path simulation objects based on the configuration of each type of dynamic block.
Additionally, the script has examples of both reading data and writing data back to the dwg based on modifications of the AGV paths within the simulation. The script is only partially complete as a demonstration of the API’s capabilities; the script is not a fully-working, robust solution for any arbitrary dwg.
This FDU example model contains many user commands in the Toolbox with various functionality. The primary example starts in the Load FDU Layout button’s OnPress code. By default, it calls the AutoBuildFromDwg() user command. Alternatively, it has unreachable example code for calling AutoBuildFromLayout(), which can read the layout data from an FDU LayoutData xml file rather than a dwg file.
The AutoBuildFromDwg() user command reads factory-specific meta-data about each FDU block in the dwg file and automatically creates simulation objects for each. The simulation objects then load the custom 3D shapes from FDU representing each of those objects. The import script also sets labels with the various Factory properties from each object. Within the CreateSimulationObjects() and CreateInternalObjects() user commands—called from the CreateFactoryAssetInstance() command—are hard-coded checks for particularly factory asset family ids to determine what type of simulation objects to create. This is merely a proof-of-concept example for handling FDU assets via FlexScript without any changes to FDU assets themselves. Future enhancements may include options for including such simulation meta-data within FDU assets directly for a more robust, easier-to-use solution.
This workflow brings all the new Autodesk interop features together for an exciting, new way to bring factory data into FlexSim. Once that data is in FlexSim, you can use its many existing features to analyze the system with live 3D animation and dashboard charts showing simulation results. You can validate the throughput of the layout, identify potential bottlenecks, and balance resource use.
Hi @Phil BoBo
I am trying to add the Autodesk InterOp into FlexSim. I downloaded the third-party file and placed the module in the FlexSim program files under the "module" folder. is this the correct way, Because I am unable to access the buttons when I click on them in dashboards in the model.
Hi @Phil BoBo ,
can you share FDU and dwg file for the third example?
Otherwise I can't use and play with your POC.
FDU is part of Autodesk's Product Design & Manufacturing Collection.
https://www.autodesk.com/products/factory-design-utilities/overview
FDU is required to use the POC model I posted. The purpose of the model is to demonstrate data integration between applications. FlexSim, Factory Design Utilities, and the AdskInterop Module are all required for the POC model to work. The POC doesn't just read layout data generated from FDU; it reads ipt files from FDU's asset library, which requires FDU to be installed for this workflow.
Hi @Phil BoBo,
this is a great feature. However when I downloaded the Autodesk Interoperability FlexSim module to be able to read the .dwg file and autobuild the model, different models that include a big .dwg layout cannot simply load and open. As I tracked the overall performance, RAM is fully utilized (reaching 100%).
I have also tried openning these models in a different FlexSim version (without the AIF module) and everything works perfectly.
I am not sure if this can be a bug, but I wanted to let you know and ask for your opinion.
Thank you,
Martin
Thanks for the feedback. We would need to test the dwg file to debug what is happening and what we can do about it. I'll send you an email.
Be aware that for each of the three supported formats, DWG, Inventor, and RevIt another component install is required! Maybe it happened just to me, since I have no ADSK products installed on my machine. However, the download is initiated the first time you actually try to import that file format in FlexSim and all three take a while to download and install.
To avoid that in a presentation scenario, import a dwg, a ipt, and a rvt after installng the module. 😉
Hi, I stumbled upon this post, because I would like to improve our connectivity from Revit to Flexsim.
Downloaded the Tool, run installation as Admin.
created an small model in Revit 2022. Tried to load.
Several try but altime same result. the befor placed Item is gone and no model on the ground area.
working with the current 25.0.1.Test-Revit_Import.zip
this is the view, how it looks in Revit.
I was able to load the file you attached just fine:
Is the AdskInterop module installed and loaded properly in FlexSim? Does it show in your Help > About FlexSim screen?
The first time you try to load a rvt file, it should have prompted you to install the Revit interoperability software. Did you install it? Did you try again after that was installed?
Is your file currently opened by another program, such as Revit itself? If another program has a lock on the file, then FlexSim won't be able to read it.
I am encountering the same problem (probably). The module shows as installed, but when loading a file (dwg, Revit or Inventor) there is no prompt to install the respective software. A new process called "adsk_hive_host.exe" pops up in the task manager for maybe a second before disappearing again. Nothing seems to happen afterwards.
In relation to this:
As explained above for version 24.2.2 I did install the InterOp module and was prompted to install three more ADSK components when trying to load the three file formats into FlexSim. Worked well in 24.2.2 and I was also able to open the RevIt file posted above by Heinrich.
However, when I wanted to install the InterOp module for 25.0, the installer showed this splash:
FlexSim 25.0 does not show the module as installed. RevIt and Inventor files are not recognized for 3D shape import and DWG seems to load the "old" way only.
I thought the module needs to be reinstalled for each FlexSim version with the matching version no. Is that not the case? Does an older version of the module have to be removed before installing the current one?
Thx
Hi @Ralf Gruber
i removed the 25 and started the installation for 24.2.2 and now I got the window mentioning to need something for revit in particular. maybe in 25 this is missing.
but my installatoin failed with "Error 5"
is there a resource to get the tool downloaded? maybe it will be helpful to add the neccesary links to the download page.
I'm not aware of any way to get the Revit Interoperability component other than using that installer.
Did you try rebooting your computer and trying again?
Perhaps it is a permission issue? You could try running FlexSim as an administrator so that the installer runs under elevated credentials? (This shouldn't be necessary, but maybe something configured on your system is blocking the installer?)
Do you have a bad internet connection? Perhaps the installer was unable to download some required files correctly? Perhaps try to install it with a more stable internet connection?
I'll add a note to the dev list to see if we can replicate these issues with installing the interoperability components and improve this.
Hi,
I have admin rights on my device, so there should not be any issues. also I used to make restarts after installations or removings to avoid some issues.
I tried to run the application as admin - no differenz.
for me the biggest question is, why there is a need for another installation when I try to use the tool? why isnt it installed with the Add-on? and how can I manuelly adding the requiered parts?
and why it was not pushing the installation with only installed the 25.?
removing 25 and adding 24.2 first went to the request for additional installation.
Is the 24 for Flexsim 2024 and the version 25 for Flexsim 2025?
because the installation path when I start the
I have a good bandwith connected with LAN and my internet is stable all the time.
the installatoin progress starts to go down after reaching 23% and ends with the "Error 5" again. but I cant figure out, what might be the reason...
Sorry, I have no clean device for testing purpuse - I am on single licensing and would like to get that tool up and running on my device. 😕
I have run the installation for Flexsim 2025.0.2 and the AutodeskInterop 25. both with admin rights. the Flexsim went smoth - the AutodeskInterop shows me, that the installation exists. but when I compare the folders and also start Flexsim 2025 there is no AutodeskInterOp Add-On loaded.
maybe we should try to solve the issue in PM?
@Ralf Gruber @Felix Möhlmann @Heinrich
We just uploaded a new 25.0 AdskInterop installer that fixes the issue of installing 24.2 and 25.0 on the same computer.
Hi Matt,
I have downloaded the new installer (dated 2024-12-17 though?):
After Installation, all three importers still work for 2024.2.2. In 25.0.2 both, Inventor and DWG work well. However I can't get FlexSim to load RevIt properly:
- The script window that shows up in 24.2.2 when loading a .rvt file for a while shows for a split of a second in 25.0.2 only
- The tree shows the correct path to the .rvt file assigned to an object, but the 3D isn't showing anything for that object.
Can you confirm, please?
you didnt change the version? thats confusing.
Only installing the 25.0 version had the same outcome as before. No prompt to install the modules was shown when first attempting to import a dwg, rvt or ipt file.
After uninstalling the 25.0 version, then installing 24.2 and then also 25.0 again the prompts appeared in 25.0 as well and I could successfully import all file types.
the updated installed didnt work for me.
again, I got the "Error 5" when I tried to open a Revit-File.
but. I found a way and now I have solved it on my side.
went to autodesk.com. since I have access to all software downloads I searched for that specific part.
It is in the Inventor area
now I was able to open a Revit-File - great.
Now I start to dream about future solutions. maybe like with Inventor and FUD parts. What might happen, when Revit-Families can be used for Flexsim-3D-Shape direktly in that layout...
waiting for a great future...