Import Inventor API to use GetLayers() in iLogic?

Import Inventor API to use GetLayers() in iLogic?

mk92
Collaborator Collaborator
327 Views
1 Reply
Message 1 of 2

Import Inventor API to use GetLayers() in iLogic?

mk92
Collaborator
Collaborator

Hi, i want to get the 3D Layers of my Factory Layout via iLogic. I am able to import the Factory API but GetLayers() function seems to be part of the normal Inventor API. 

What do i need to Import to use this function?

 

Here is a link to the Help page where the Function is shown: LINK

 

Here is the code i want to use in iLogic (NOT VBA):

 

var layers = api.GetLayers(layout);
System.Windows.MessageBox.Show(layers.Length.ToString(), Get  COUNT”);

 

0 Likes
328 Views
1 Reply
Reply (1)
Message 2 of 2

WCrihfield
Mentor
Mentor

I'm not familiar with the 'Factory Design Utilities', and I'm not 'fluent' in C# (I assume that's the programming language being used in that reference link),  but when working with a DrawingDocument in regular Inventor Pro, here's one way to get the drawing's Layers using iLogic:

Dim oDDoc As DrawingDocument = ThisDrawing.Document
Dim oLayersEnum As LayersEnumerator = oDDoc.StylesManager.Layers
Dim oLayersCount As Integer = oLayersEnum.Count
MsgBox("There are " & oLayersCount & " layers in this drawing.",,"")
'Dim oLayer As Inventor.Layer = oLayersEnum.Item(1)

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you have time, please... Vote For My IDEAS 💡or you can Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes