Automate Assembly from a JSON?

Automate Assembly from a JSON?

AndrewBurson
Participant Participant
607 Views
4 Replies
Message 1 of 5

Automate Assembly from a JSON?

AndrewBurson
Participant
Participant

Say I have a fairly complex product assembly of several hundred parts. The assembly is automated with a large variety of options that affect everything from the overall assembly dimensions, to individual custom options that may affect one or more parts within the assembly. Assume that all the automation is controlled via forms and iLogic.

 

1) Would it be possible to create an additional layer of automation (via iLogic, VB code, or something else) that can import a JSON file, use the information within the JSON to fill out the forms, and generate a complete model?

2) If the above is possible, what kind of rough framework would be required to make this happen? (IE: could it be done with a script inside Inventor, or would a new program need to be created to act as an interface?)

3) How complex/time consuming would it be to build something like this? (assuming an expert was hired)

 

Sorry for the vagueness of all this. I've been asked to figure this out, and automation beyond iLogic is beyond my level of expertise.

0 Likes
Accepted solutions (2)
608 Views
4 Replies
Replies (4)
Message 2 of 5

tyler.warner
Advocate
Advocate
Accepted solution

@AndrewBurson  There are NuGet Packages for Visual Studio that do the JSON conversion for you such as Json.NET. So it would be relatively simple to use the JSON as input. This would require using an add-in for Inventor. You can find a lot of tools on this topic by searching the forums. A good one to start with is this post & this video walkthrough. The add-in can then run any iLogic that you need for the product assembly.

 

Edit: You may be able to include these tools into iLogic by importing them as libraries as well like Johan mentions below & not have to do the work of developing an add-in.

If this solved your problem or answered your question, please click ACCEPT SOLUTION.
If this helped you, please click LIKE.
0 Likes
Message 3 of 5

JMGunnar
Collaborator
Collaborator
Accepted solution

Autodesk Forge 

you convert Json string too data 

then update Forms or run rule too build you internal Assembly

 

 

Best Regards Johan 

 

AddReference "Newtonsoft.Json.dll"

 

 

json = My.Computer.FileSystem.ReadAllText(System.IO.Path.GetDirectoryName(ThisDoc.Path) & "\Params.json", System.Text.Encoding.ASCII)
			Dim data = Newtonsoft.Json.JsonConvert.DeserializeObject(json)

 

 

"InventorParams": {
"localName": "params.json",
"url": "data:application/json, {\"Model_Name\":\"GLD-013\",\"FluidNameHotSide\":\"ISO VG 46\",\"FluidNameColdSide\":\"Eau\",\"TotalFlowHotSideLiquidIn\":4.262405842469795,\"TotalFlowHotSideLiquidOut\":4.262405842469795,\"TotalFlowColdSideLiquidIn\":3.189143092881799,\"TotalFlowColdSideLiquidOut\":3.189143092881799,\"TotalFlowHotSideVaporIn\":0,\"TotalFlowHotSideVaporOut\":0,\"TotalFlowColdSideVaporIn\":0,\"TotalFlowColdSideVaporOut\":0,\"OperatingTempHotSideIn\":27,\"OperatingTempHotSideOut\":22,\"OperatingTempColdSideIn\":15,\"OperatingTempColdSideOut\":18,\"OperatingPressureHotSideIn\":0,\"OperatingPressureHotSideOut\":0,\"OperatingPressureColdSideIn\":0,\"OperatingPressureColdSideOut\":0,\"PressureDropHotSideAllowed\":50,\"PressureDropHotSide\":31.99538322892102,\"PressureDropColdSideAllowed\":50,\"PressureDropColdSide\":2.612536594812682,\"TotalHeatExchanged\":40,\"UService\":417.7433980733148,\"UClean\":420.03796785539964,\"TotalHeatTransferArea\":12.032,\"LMTD\":7.958158286735946,\"S1_Type\":\"Threaded 7/1R\",\"S2_Type\":\"Threaded 7/1R\",\"S3_Type\":\"Threaded 7/1R\",\"S4_Type\":\"Threaded 7/1R\",\"S1_Size\":\"R 2\\\"\",\"S2_Size\":\"R 2\\\"\",\"S3_Size\":\"R 2\\\"\",\"S4_Size\":\"R 2\\\"\",\"S1_Rating\":\"Tube Connection\",\"S2_Rating\":\"Tube Connection\",\"S3_Rating\":\"Tube Connection\",\"S4_Rating\":\"Tube Connection\",\"S1_Material\":\"1.4401\",\"S2_Material\":\"1.4401\",\"S3_Material\":\"1.4401\",\"S4_Material\":\"1.4401\",\"M1_Type\":\"\",\"M2_Type\":\"\",\"M3_Type\":\"\",\"M4_Type\":\"\",\"M1_Size\":\"\",\"M2_Size\":\"\",\"M3_Size\":\"\",\"M4_Size\":\"\",\"M1_Rating\":\"\",\"M2_Rating\":\"\",\"M3_Rating\":\"\",\"M4_Rating\":\"\",\"M1_Material\":\"\",\"M2_Material\":\"\",\"M3_Material\":\"\",\"M4_Material\":\"\",\"PassArrangementHotSide\":\"1+0\",\"PassArrangementColdSide\":\"1+0\",\"ChannelArrangementHotSide\":\"47H+0H\",\"ChannelArrangementColdSide\":\"48H+0H\",\"A_Dimension\":0.3168,\"C_Dimension\":0.84,\"HeatTransferPlateMaterial\":\"1.4401\",\"HeatTransferPlateThickness\":0.4,\"GasketMaterialHotSide\":\"NBR\",\"GasketMaterialColdSide\":\"NBR\",\"NumberOfHeatTransferPlates\":96,\"ExpansionPossibility\":10,\"FrameMaterial\":\"P265GH Carbon Steel\",\"FramePaintSystem\":\"Enamel\",\"FrameColor\":\"RAL 5012 (Royal Blue\",\"TieBoltMaterial\":\"8.8\",\"TieNutMaterial\":\"8.8\",\"TieBoltAssyFinish\":\"FZB\",\"DesignPressurePEDHotSide\":10,\"DesignPressureASMEHotSide\":10,\"DesignPressurePEDColdSide\":10,\"DesignPressureASMEColdSide\":10,\"TestPressurePEDHotSide\":14.3,\"TestPressureASMEHotSide\":14.3,\"TestPressurePEDColdSide\":14.3,\"TestPressureASMEColdSide\":14.3,\"MaxDesignTemperature\":80,\"MinDesignTemperature\":0,\"VolumeHotSide\":0.015512350481003545,\"VolumeColdSide\":0.015842400491237665,\"UnitWeightEmpty\":180.30879676886178,\"UnitWeightFlooded\":209.84806576584216,\"PressureVesselDesignCode\":\"PED\",\"PressureClassCode\":\"P\",\"SupportTypeCode\":\"R\",\"HotInlet\":\"S1\",\"HotOutlet\":\"S3\",\"ColdInlet\":\"S2\",\"ColdOutlet\":\"S4\",\"VolumeHotSideUOM\":\"CubicMeters\",\"VolumeColdSideUOM\":\"CubicMeters\",\"TotalFlowHotSideUOM\":\"KiloGramsPerSec\",\"TotalFlowColdSideUOM\":\"KiloGramsPerSec\",\"OperatingTempHotSideInUOM\":\"Celsius\",\"OperatingTempHotSideOutUOM\":\"Celsius\",\"OperatingTempColdSideInUOM\":\"Celsius\",\"OperatingTempColdSideOutUOM\":\"Celsius\",\"OperatingPressureHotSideUOM\":\"BarAbsolute\",\"OperatingPressureColdSideUOM\":\"BarAbsolute\",\"PressureDropHotSideAllowedUOM\":\"KilopascalsAbsolute\",\"PressureDropHotSideUOM\":\"KilopascalsAbsolute\",\"PressureDropColdSideAllowedUOM\":\"KilopascalsAbsolute\",\"PressureDropColdSideUOM\":\"KilopascalsAbsolute\",\"TotalHeatExchangedUOM\":\"KiloWatts\",\"UServiceUOM\":\"WATTS_M2K\",\"UCleanUOM\":\"WATTS_M2K\",\"TotalHeatTransferAreaUOM\":\"MeterSqrd\",\"LMTDUOM\":\"Kelvin\",\"DesignPressureUOM\":\"BarGauge\",\"TestPressureUOM\":\"BarGauge\",\"MaxDesignTemperatureUOM\":\"Celsius\",\"MinDesignTemperatureUOM\":\"Celsius\",\"UnitWeightEmptyUOM\":\"KiloGrams\",\"UnitWeightFloodedUOM\":\"KiloGrams\"}"
},

 

[01/23/2023 12:40:26] InventorCoreConsole.exe Information: 0 : HeartBeating every 50000ms.
[01/23/2023 12:40:26] InventorCoreConsole.exe Information: 0 : Parameter to change: Model_Name:GLD-013
[01/23/2023 12:40:26] InventorCoreConsole.exe Information: 0 : Parameter to change: FluidNameHotSide:ISO VG 46
[01/23/2023 12:40:26] InventorCoreConsole.exe Information: 0 : Parameter to change: FluidNameColdSide:Eau

 

 

 

 

 

0 Likes
Message 4 of 5

zorin_andrey
Community Visitor
Community Visitor

You can create a form that lets you select a JSON file. Then you parse it inside the Addin and use the data to manipulate your model. That's how I did it. But we dont use iLogic scripts. All code responsible for creation of Parts is inside the Addin (in C#). i used Newsoft.JSON library from NuGet repo for JSON parsing.

0 Likes
Message 5 of 5

rzsla
Contributor
Contributor

Hi,

how do you pass these parameters into inventor after deserialise? And proceed to run the automation after passing these parameters?

0 Likes