FDU API Automation Layers

FDU API Automation Layers

mouse
Enthusiast Enthusiast
1,478 Views
6 Replies
Message 1 of 7

FDU API Automation Layers

mouse
Enthusiast
Enthusiast

i`m running into an issue with the FDU 2019 API.

The Layers seem to work now, but only to a certain extent. When Layers exists within a Layout, i get an iLogic error message.

 

More workflow datails here:

Screencast API Layers

 

How can this be avoided? Am i missing out on an API Funktion somewhere?

 

 

 

0 Likes
Accepted solutions (1)
1,479 Views
6 Replies
Replies (6)
Message 2 of 7

liqinomickey
Autodesk
Autodesk

Hi Mouse,

This is Mickey.Smiley Tongue

How did you place the assets in different layers? Are you using, "Automatic Layering" function in FDU or are you using something else? I am asking because in Factory API, we do not support placing assets in specific layers. I am curious how are you doing it.

Could you please show us the code in iLogic please. Thank you.

Mickey

[email protected]



Mickey Li
Product Manager
ACS Docs Platform feature team
Autodesk, Inc.

0 Likes
Message 3 of 7

mouse
Enthusiast
Enthusiast

Hi Mickey,

We are using solely "Automatic Layering" function in FDU.

These Layers are all predefined in our Assets. 

 

The Layers are defined with the Asset builder here:

Objectbuilder_layers.jpg

 

 

The API works well when publishing Assets without a Layer preundefined, as shown here:

Objectbuilder_layers_undefined.jpg

 

 

But deleting Layers out of all our Assets is no Option for us. In 2018.2 all works fine.

 

Mouse

 

 

0 Likes
Message 4 of 7

mouse
Enthusiast
Enthusiast

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

 

0 Likes
Message 5 of 7

mouse
Enthusiast
Enthusiast

Hi Mickey

 

We can Import our Layouts again, once the "Automatic Layering" function in FDU is switched off.

The only thing is, that we can forget to turn it on again, when we insert assets the conventional way.

 

Is Autodesk working on that bug?

 

Mouse

0 Likes
Message 6 of 7

yizhou.cao
Autodesk
Autodesk
Accepted solution

Hi,

We'll look into the issue. Thanks for reporting it.

 

Yizhou C
Autodesk Factory Design team

Message 7 of 7

mouse
Enthusiast
Enthusiast

Hi Yizhou,

The issue has been fixed with the 2019.1 Update.

Thankyou.

 

 

Cheers Mouse