iLogic execute rule in part of assembly

iLogic execute rule in part of assembly

sathish_rD64VU
Participant Participant
210 Views
4 Replies
Message 1 of 5

iLogic execute rule in part of assembly

sathish_rD64VU
Participant
Participant

When I execute an iLogic rule in my part, it takes a significant amount of time to complete. I have written rules for simple processes, yet they still take hours to execute. How can I reduce the execution time of these rules in Inventor? I have already raised a case with Autodesk 23956036, but they have been unable to provide a solution. I kindly ask for your assistance in resolving this issue, as it is affecting our commitments to our customers.

0 Likes
211 Views
4 Replies
Replies (4)
Message 2 of 5

ryan.rittenhouse
Advocate
Advocate

Lots of things can affect how long your ilogic takes to run. Some processes are very computationally expensive and some methods of doing things are less efficient than others. Can you post your code so we can see what it's doind?

If this solved your problem, or answered your question, please click Accept Solution.
0 Likes
Message 3 of 5

sathish_rD64VU
Participant
Participant

Hi Ryan, I have shared a part of code here, Please check it and give suggestions: 

Dim Result As DialogResult = MessageBox.Show("Need to update the Master model as per model input excel", "Updation request", MessageBoxButtons.YesNo, MessageBoxIcon.Question)

'Result = MessageBox.Show("Need to update the Master model as per model input excel", _

'"Updation request", _

'MessageBoxButtons.YesNo, _

'MessageBoxButtons.YesNo, _

'MessageBoxIcon.Question, MessageBoxDefaultButton.Button1)

 

 

If Result = DialogResult.Yes Then

' Define the path to the Excel file

Dim excelFilePath As String

excelFilePath = "Z:\DESIGN\O T H E R S\JEDIT CALVIN JEHOASH\TCS\Ball strainer Model Inputs.xlsm"

 

' Get the Excel application object

Dim excelApp As Object

excelApp = CreateObject("Excel.Application")

       

' Open the Excel workbook and sheet

Dim excelWorkbook As Object

Dim excelSheet As Object

excelWorkbook = excelApp.Workbooks.Open(excelFilePath)

excelSheet = excelWorkbook.Sheets("Modelinputs") ' Your specific sheet name

 

 

' Get values from Excel and update Inventor parameters

'Parameter("FLANGE_STANDARD") = excelSheet.Range("C2").Value

'Parameter("RAISED_FACE_FLAT_FACE") = excelSheet.Range("C3").Value

'Parameter("AWWA_DN") = excelSheet.Range("C4").Value

'Parameter("AWWA_CLASS") = excelSheet.Range("C5").Value

'Parameter("ASME_DN") = excelSheet.Range("C6").Value

'Parameter("SHELL_LENGTH") = excelSheet.Range("C8").Value

'Parameter("SHELL_THK") = excelSheet.Range("C9").Value

 

'Parameter("SCREEN_ANG") = excelSheet.Range("C10").Value

 

 

'-------------------------EXCEL INPUTS-----------------------------------------------------------------------------------------------------------------------

 

'COMMON DATA

Parameter("MASTER Sketch:1", "SCR_ELI_LEN") = excelSheet.Range("F19").Value 'SCREEN ELIPSE LENGTH

Parameter("MASTER Sketch:1", "DN") = excelSheet.Range("C18").Value 'DN SIZE OF THE SHELL WHICH IS BALL STRAINER'S ID

Parameter("MASTER Sketch:1", "FLANGE_STANDARD") = excelSheet.Range("C7").Value 'MAIN FLANGE STANDARD

Parameter("MASTER Sketch:1", "RUBBER_LINING") = excelSheet.Range("H7").Value 'RUBBER LINING THICKNESS

Parameter("MASTER Sketch:1", "SHELL_LENGTH") = excelSheet.Range("C19").Value ' OVERALL LENGTH OF THE SHELL

Parameter("MASTER Sketch:1", "SHELL_THK") = excelSheet.Range("C9").Value 'THICKNESS OF THE SHELL

 

 

'--------------------------SPECIAL LINKING------------------------------------------------------------------------------------------------------------------------------

 

Parameter("MASTER Sketch:1", "SCR_SUP_PIPE_DIS1") = excelSheet.Range("L31").Value

Parameter("MASTER Sketch:1", "SCR_SUP_PIPE_DIS2") = excelSheet.Range("L32").Value

Parameter("MASTER Sketch:1", "SCR_SUP_PIPE_DIS3") = excelSheet.Range("L33").Value

Parameter("MASTER Sketch:1", "SCR_SHOE_PLATE_LEN") = excelSheet.Range("L34").Value

Parameter("MASTER Sketch:1", "SCR_GUS_STIF_N") = excelSheet.Range("L35").Value

Parameter("MASTER Sketch:1", "BALL_EXT_FIX_27") = excelSheet.Range("I21").Value'CHANGED LOCATION-"ALSO IN BOTTOM"

Parameter("MASTER Sketch:1", "BALL_EXT_FIX_49") = excelSheet.Range("L36").Value

Parameter("MASTER Sketch:1", "BALL_EXT_FIX_9") = excelSheet.Range("L37").Value

Parameter("MASTER Sketch:1", "SCREEN_LEN_1") = excelSheet.Range("L38").Value

Parameter("MASTER Sketch:1", "SCR_STIFFNER_GAP1") = excelSheet.Range("L39").Value

'Parameter("MASTER Sketch:1", "SCR_STIFFNER_GAP3") = excelSheet.Range("Bxx").Value

'Parameter("MASTER Sketch:1", "NAME") = excelSheet.Range("Bxx").Value

Parameter("MASTER Sketch:1", "SCR_STIFFNER_GAP4") = excelSheet.Range("L42").Value

'Parameter("MASTER Sketch:1", "NAME") = excelSheet.Range("Bxx").Value

'Parameter("MASTER Sketch:1", "NAME") = excelSheet.Range("Bxx").Value

Parameter("MASTER Sketch:1", "SCR_STIF_LEN1") = excelSheet.Range("L45").Value

Parameter("MASTER Sketch:1", "SCR_H_STIFF_NP1") = excelSheet.Range("L46").Value

Parameter("MASTER Sketch:1", "SCR_H_STIFF_NP2") = excelSheet.Range("L47").Value

Parameter("MASTER Sketch:1", "SCR_SPL_STIFF_NP") = excelSheet.Range("L48").Value

Parameter("MASTER Sketch:1", "BACKWASH_ANG") = excelSheet.Range("L49").Value

Parameter("MASTER Sketch:1", "SCR_FIX_24") = excelSheet.Range("L50").Value

Parameter("MASTER Sketch:1", "SCR_SUP_PIPE_MIN_DIS2") = excelSheet.Range("L51").Value

'Parameter("MASTER Sketch:1", "SCR_SUP_PIPE_MIN_DIS1") = excelSheet.Range("Bxx").Value

Parameter("MASTER Sketch:1", "SCR_RIB_WIDTH") = excelSheet.Range("L53").Value

Parameter("MASTER Sketch:1", "SHAFT_DIA") = excelSheet.Range("L54").Value

Parameter("MASTER Sketch:1", "SCR_RIB_GAP1") = excelSheet.Range("L19").Value'CHANGED LOCATION

Parameter("MASTER Sketch:1", "SCR_RIB_GAP2") = excelSheet.Range("L20").Value'CHANGED LOCATION

Parameter("MASTER Sketch:1", "SCR_SUP_DIS") = excelSheet.Range("L55").Value

Parameter("MASTER Sketch:1", "SCR_FIX_7") = excelSheet.Range("L56").Value

 

 

 

SCREEN_ANG = excelSheet.Range("C21").Value

BACKWASH_ANG = 360 - excelSheet.Range("L49").Value

 

'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

'main flange nozzle

If Parameter("MASTER Sketch:1", "FLANGE_STANDARD") = "Awwa-Class B" Then

Parameter("MASTER Sketch:1", "AWWA_MF_OD") = excelSheet.Range("C40").Value

Parameter("MASTER Sketch:1", "AWWA_MF_N_H") = excelSheet.Range("C41").Value

Parameter("MASTER Sketch:1", "AWWA_MF_PCD") = excelSheet.Range("C42").Value

Parameter("MASTER Sketch:1", "AWWA_MF_H_DIA") = excelSheet.Range("C43").Value

Parameter("MASTER Sketch:1", "AWWA_MF_THK") = excelSheet.Range("C44").Value

 

ElseIf Parameter("MASTER Sketch:1", "FLANGE_STANDARD") = "Awwa-Class D" Then

Parameter("MASTER Sketch:1", "AWWA_MF_OD") = excelSheet.Range("C40").Value

Parameter("MASTER Sketch:1", "AWWA_MF_N_H") = excelSheet.Range("C41").Value

Parameter("MASTER Sketch:1", "AWWA_MF_PCD") = excelSheet.Range("C42").Value

Parameter("MASTER Sketch:1", "AWWA_MF_H_DIA") = excelSheet.Range("C43").Value

Parameter("MASTER Sketch:1", "AWWA_MF_THK") = excelSheet.Range("C45").Value

 

ElseIf Parameter("MASTER Sketch:1", "FLANGE_STANDARD") = "ASME" Then

Parameter("MASTER Sketch:1", "ASME_MF_OD") = excelSheet.Range("C48").Value

Parameter("MASTER Sketch:1", "ASME_MF_THK") = excelSheet.Range("C49").Value

Parameter("MASTER Sketch:1", "ASME_MF_M_THK") = excelSheet.Range("C50").Value

Parameter("MASTER Sketch:1", "ASME_MF_HUB_DIA") = excelSheet.Range("C51").Value

Parameter("MASTER Sketch:1", "ASME_MF_RF_DIA") = excelSheet.Range("C52").Value

Parameter("MASTER Sketch:1", "ASME_MF_R") = excelSheet.Range("C53").Value

Parameter("MASTER Sketch:1", "ASME_MF_N_H") = excelSheet.Range("C54").Value

Parameter("MASTER Sketch:1", "ASME_MF_PCD") = excelSheet.Range("C55").Value

Parameter("MASTER Sketch:1", "ASME_MF_H_DIA") = excelSheet.Range("C56").Value

End If

 

 

'N1 - Nozzle

Parameter("MASTER Sketch:1", "N1_XAXIS") = excelSheet.Range("B25").Value

Parameter("MASTER Sketch:1", "N1_YAXIS") = excelSheet.Range("B26").Value

Parameter("MASTER Sketch:1", "N1_DIS") = excelSheet.Range("B27").Value

Parameter("MASTER Sketch:1", "N1_PIPE_OD") = excelSheet.Range("B28").Value

Parameter("MASTER Sketch:1", "N1_PIPE_THK") = excelSheet.Range("B29").Value

Parameter("MASTER Sketch:1", "N1_FLG_OD") = excelSheet.Range("B30").Value

Parameter("MASTER Sketch:1", "N1_FLG_PCD") = excelSheet.Range("B31").Value

Parameter("MASTER Sketch:1", "N1_FLG_H_DIA") = excelSheet.Range("B32").Value

Parameter("MASTER Sketch:1", "N1_FLG_NH") = excelSheet.Range("B33").Value

Parameter("MASTER Sketch:1", "N1_FLG_ID") = excelSheet.Range("B34").Value

Parameter("MASTER Sketch:1", "N1_FLG_THK") = excelSheet.Range("B35").Value

0 Likes
Message 4 of 5

jwingateRJECD
Enthusiast
Enthusiast

Do you have the excel reference/interop at the header of your rule?

 

AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop
Imports Microsoft.Office.Interop.Excel 

 

0 Likes
Message 5 of 5

sathish_rD64VU
Participant
Participant

Hi Ryan,  We didn't add Excel reference at the header of the rule. Autodesk Team replied to our case and  they suggest that "commenting out the calls to Constraints.AddUcsToUcs() improves the performance of the rules", This gives good results.

0 Likes