Procedure in iLogic

Procedure in iLogic

abilabib
Advocate Advocate
414 Views
2 Replies
Message 1 of 3

Procedure in iLogic

abilabib
Advocate
Advocate

How to create and use procedure in iLogic. 

I have try for create simple procedure / function in iLogic but can't work.

 

function LOD (ByVal a as string) as DrawingView 
ThisApplication.FileManager.GetLastActiveLevelOfDetailRepresentation(a)
end function 

LOD_Assy = LOD(DirName)

 

0 Likes
415 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support

Hi,

 

When you define a procedure, you need to define Main procedure for the main workflow. And if a procedure is a function, you need to make sure to provide a return value for the function. Please refer to the code snippet below.

 

Sub Main()
  Dim DirName As String 
  DirName = "c:\Assembly2.iam"
  LOD_Assy = LOD(DirName)
End Sub

Function LOD (ByVal a As String) As DrawingView 
   Dim oLODStr As String
   
   oLODStr = ThisApplication.FileManager.GetLastActiveLevelOfDetailRepresentation(a)
   
   'just to make sure the prcedure is called
   MsgBox(oLODStr)
   
   ' do your job to get a drawing view...
   ' remember  assign the drawing view to the 
   ' function name LOD as the return value
   
   ' LOD = .....
   
   'I set it to nothing just for demo
   LOD = Nothing
   
End Function 
0 Likes
Message 3 of 3

abilabib
Advocate
Advocate

Thanks for your reply. 

I'll try Smiley Wink

0 Likes