Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 516

Listing the Positional Representations in iLogic Form

$
0
0

By Balaji Ramamoorthy

The Positional Representations in an assembly document can change as you add or remove any of the representations. If you need to list the names of the representations in a combo-box inside your iLogic form, here is a way to do that.

Step-1 : Create a Multi-value user parameter of Text type. In the below example, we name this parameter as "PosReps"

Step-2 : In your iLogic form, drag the user-parameter created in Step-1. As it is a multi-value parameter, a combo-box will display its values

Step-3 : In your iLogic Rule, before you display the iLogic form, update the user parameter by iterating through the positional representation in the assembly document. Here is a sample iLogic rule that updates the user parameter named "PosReps" :

Dim  oAsmDoc AsAssemblyDocument
 oAsmDoc = ThisApplication.ActiveDocument
Dim  oAsmCompDef AsAssemblyComponentDefinition
 oAsmCompDef = oAsmDoc.ComponentDefinition
Dim  oPosReps AsPositionalRepresentations
 oPosReps = oAsmCompDef.RepresentationsManager _
 .PositionalRepresentations
Dim  List() AsString
ReDim  List(0 To  oPosReps.Count-1)
Dim  cnt AsInteger
 cnt = 0
Dim  oPosRep AsPositionalRepresentation
ForEach  oPosRep In  oPosReps
 	List(cnt) = oPosRep.Name
 	cnt = cnt + 1
Next
Dim  oPars AsUserParameters
 oPars = _
 oAsmDoc.ComponentDefinition.Parameters.UserParameters
Dim  oPar AsUserParameter
 oPar = oPars.Item("PosReps")
Dim  oExprList AsExpressionList
 oExprList = oPar.ExpressionList
Call  oExprList.SetExpressionList(List, False )
 oAsmDoc.Update
 iLogicForm.Show("Positional Reps")

Here is a screenshot of the iLogic form displaying the positional representations:

ILogic_PosReps

Viewing all articles
Browse latest Browse all 516

Trending Articles