Hi Mickey,
The issue we had with 2018.2 was that the inserted Assets were all on Layer 0. Allthough the assets were published with a Layer.
With FDU 2019 the Problem should have been fixed. It does work now. But as soon as two same assets are placed in the Layout, iLogic responds with a message:
Autodesk.Factory.Core.Data.Exceptions.FactoryDataModelException: Unable To create 310.31 layer for layout
bei FDM_InventorAPI.FactoryData.AddFactoryLayer(Document layoutDocument, FactoryLayerModel layerModel)
bei Autodesk.Factory.InventorFDMUtility.DataModel.LayerHandler.AddEntitiesMethod(Object nativeDocument, IList`1 entitiesToAdd)
bei Autodesk.Factory.Core.DataModel.EntityHandlerBase`1.AddEntities(Object nativeDocument, IList`1 entitiesToAdd)
bei Autodesk.Factory.InventorFDMUtility.InventorFactoryDataModelUtility.AddLayers(Object targetDocumentEntity, IList`1 layers)
bei Autodesk.Factory.Core.PublicAPIImpl.FactoryAPI.Autodesk.Factory.PublicAPI.Currency.v2.IFactoryAPI.AddAssetInstances(Object Layout, IAssetInstance[] instances)
bei ThisRule.Main()
bei Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
bei iLogic.RuleEvalContainer.ExecRuleEval(String execRule)
I only used: API.Autodesk.Factory.PublicAPI.Currency.v2.IFactoryAPI.AddAssetInstances(Object Layout, IAssetInstance[] instances)
The FDM_InventorAPI.FactoryData.AddFactoryLayer seems to called by AddAssetInstances itself.
What is needed is a verifcation if the Layer exists so that the Funktion FDM_InventorAPI.FactoryData.AddFactoryLayer will not be invoked again.
mouse