- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi All,
I am modelling a tank template and have an assembly parameter for the tank contents specific gravity. This is sent to a model of the tank contents to adjust the density (and thereby the mass).
This works fine in the part environment but errors when updated from the assembly. I'm pretty sure it's to do with the oPartDoc = ThisApplication.ActiveDocument and trying to trigger it from a different file. I do a lot of conditional statements, isactive functions etc... but the finer points of how and when rules are run is beyond me at this stage...
This is the code (taken from this post - thanks guys https://forums.autodesk.com/t5/inventor-forum/using-ilogic-to-set-material-properties/td-p/5278523😞
Sub Main() oPartDoc = ThisApplication.ActiveDocument Dim oMaterial As Material oMaterial = oPartDoc.Materials.Item("Water") oMaterial.Density = (1*ProductMaxSG) End Sub
This is the error when the ProductMaxSG parameter is altered from the assembly form:
Cheers,
Glenn
Solved! Go to Solution.