How Do get Action Dialogue Box in ILogic?

How Do get Action Dialogue Box in ILogic?

Anonymous
Not applicable
1,237 Views
8 Replies
Message 1 of 9

How Do get Action Dialogue Box in ILogic?

Anonymous
Not applicable

Hi,

I'm working on a task to Create and Control Angle constraint of components using ILogic.

I have created required ILogic codes for Variable operations (i.e New Angle constraint creation, Changing Angle Value)

But I want to Include these Options in Action Dialogue Box (See the Attachment)

So while I run the ILogic rule I can select the required operations.

Please help me with Suggestions how to get the Selection Box and How to Include my ILogic Codes with that.

 

I want Below options in Action Dialogue Box:

1. Angle Constraint - Pick Option

2. Angle Constraint - Display Name Option

3. Change Angle Value

4. Delete Angle Constraint

5. Exit

 

Thanks & Regards,

Manoj Sampath

0 Likes
Accepted solutions (1)
1,238 Views
8 Replies
Replies (8)
Message 2 of 9

mcgyvr
Consultant
Consultant

@Anonymous  You forgot the attachment..

 

I assume though you are talking about making an ilogic form and placing those parameters,etc... on it.

Like this..

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Inventor-Help/files/GUID-223E9090-5118-406D-9D80-EC247997A7F4-htm.html

 

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
0 Likes
Message 3 of 9

Anonymous
Not applicable

Hi,

Sorry I forgot to Attach the example.

Thanks & Regards,

Manoj Sampath

0 Likes
Message 4 of 9

mcgyvr
Consultant
Consultant

The box in the image is an input ListBox..

See here..

InputListBox function in iLogic

https://knowledge.autodesk.com/support/inventor-products/learn-explore/caas/CloudHelp/cloudhelp/2015...

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 5 of 9

Anonymous
Not applicable

@mcgyvr 

Hi Sir,

Thanks for the Reply.

The page what you have shared having information related to Input Box List for Parameters (i.e Materials),

But in my case I have created individual ILogic codes for each operation, Please suggest me if you have any reference for this (or) Suggest me some example codes to perform this action.

 

For Your example:

Step-1 : While I run the Rule it should ask show the List of Operations

Step-2 : If I select option 01 from List, it Should Run the codes related to that operation.

 

Thanks & Regards,

Manoj Sampath 

0 Likes
Message 6 of 9

MjDeck
Autodesk
Autodesk
Accepted solution

@Anonymous , I attached a sample rule that shows an InputListBox, and then uses the selected item to choose a subroutine to run. It includes examples of variables that are in common between all subroutines. You can read or write these variables in any subroutine, including Main.

 


Mike Deck
Software Developer
Autodesk, Inc.

Message 7 of 9

Anonymous
Not applicable

Hi @MjDeck ,

Thank you very much It is working fine.

Thanks & Regards,

Manoj Sampath

0 Likes
Message 8 of 9

Anonymous
Not applicable

Hi @MjDeck ,

Like I said in my previous reply, The Code you provided is working fine.

But I want to get below Condition.

Condition:

After I pick the required action from Input list Box, The particular action working fine.

But after completing the Work I want to get Input List Box again. Below Is the Code I Have tested please help me with this.

 

Sub Main
Dim choices As New List(Of String)
choices.Add("PickOption")
choices.Add("Exit")
Dim choice = InputListBox("Select action", choices, choices(0))
If String.IsNullOrEmpty(choice) Then Exit Sub
Select Case choice
Case choices(0)
PickOption()
Case choices(1)
Exit Sub
End Select
End Sub

 

Sub PickOption()
Dim oAsm As AssemblyDocument = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition = oAsm.ComponentDefinition
Dim comp As ComponentOccurrence
Dim oAxis1 As WorkAxis
Dim oAxis2 As WorkAxis
Dim oproxyAxis2 As WorkAxisProxy
Dim oAConstraint As AngleConstraint

Line1 :
comp = ThisApplication.CommandManager.Pick(
SelectionFilterEnum.kAssemblyOccurrenceFilter,
"Select a components")
If comp Is Nothing Then Exit Sub
' If there are selected components we can do something
On Error Resume Next
oAxis1 = oAsmCompDef.WorkAxes.Item ("Y Axis")
oAxis2 = comp.Definition.WorkAxes("Y Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
If oAConstraint.HealthStatus = oAConstraint.HealthStatus.kInconsistentHealth Then
oAConstraint.Delete
oAxis1 = oAsmCompDef.WorkAxes.Item("Y Axis")
oAxis2 = comp.Definition.WorkAxes("Z Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
If oAConstraint.HealthStatus = oAConstraint.HealthStatus.kInconsistentHealth Then
oAConstraint.Delete
oAxis1 = oAsmCompDef.WorkAxes.Item("Y Axis")
oAxis2 = comp.Definition.WorkAxes("X Axis")
comp.CreateGeometryProxy(oAxis2, oproxyAxis2)
If Not ConstraintExists(comp, ObjectTypeEnum.kAngleConstraintObject, oproxyAxis2, oAxis1) Then
oAConstraint = oAsmCompDef.Constraints.AddAngleConstraint(oproxyAxis2, oAxis1, 0, 78594)
'78594 refers to the undirected angle constraint solution type. 78593 refers to
'directed (which is default), and 78595 is the referenced vector solution
oAConstraint.ConstraintLimits.MaximumEnabled = True
oAConstraint.ConstraintLimits.Maximum.Expression = "45 deg"
oAConstraint.ConstraintLimits.MinimumEnabled = True
oAConstraint.ConstraintLimits.Minimum.Expression = "0 deg"
End If
End If
End If
End If
End If
oAConstraint.ConvertToAngleConstraint(oproxyAxis2, oAxis1, 0, 78593)
GoTo Line1

End Sub

 

Function ConstraintExists(comp As ComponentOccurrence, constraintType As ObjectTypeEnum, entityOne As Object, entityTwo As Object) As Boolean
For Each existing As AssemblyConstraint In comp.Constraints
If existing.Type = constraintType Then
If (existing.EntityOne Is entityOne And existing.EntityTwo Is entityTwo) Or (existing.EntityOne Is entityTwo And existing.EntityTwo Is entityOne) Then
'Logger.Info("Constraint exists for component {0}", comp.Name)
Return True
End If
End If
Next
Return False
End Function

 

Thanks & Regards,

Manoj Sampath

0 Likes
Message 9 of 9

Anonymous
Not applicable

Hi @MjDeck 

I got the Solution. Thanks for your help.

Thanks & Regards,

Manoj Sampath

0 Likes