Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Bug iLogic rule wrong formatting with "case else"

2 REPLIES 2
Reply
Message 1 of 3
Pav3L
283 Views, 2 Replies

Bug iLogic rule wrong formatting with "case else"

Pav3L
Advocate
Advocate

Hi,

we are using Autodesk Inventor Professional 2022 and we are hawing problems with automated formatting of iLogic rules when we use "case else" in a rule.

See attached screenshots or the code below. This is just small part of a rule.

 

Wrong formatting, the "End If" after "End Select" and also the rest of the rule is shifted to the right which makes it very difficult to orient, I think it should be in line with the starting "If".

 

'LABEL PLATE AUTOMATIC CUSTOMER SELECTION
If LabelPLT_on_automatic = False Then
	Select Case Customer
		Case "NKT COLOGNE", "NEXANS ROGNAN"
			LabelPLT_on = "ONE FLANGE ONLY"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case "BRUGG CABLES", "HEXATRONIC", "ELCOWIRE"
			LabelPLT_on = "BOTH FLANGES"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case Else
	LabelPLT_on = " NONE"
	End Select
	End If

	'LABEL PLATE ON/OFF
	Select Case LabelPLT_on
		Case " NONE"
			Component.IsActive("LABELPLT A") = False
			Component.IsActive("LABELPLT B") = False
			Component.IsActive("RIVET1 A") = False
			Component.IsActive("RIVET2 A") = False
			Component.IsActive("RIVET1 B") = False
			Component.IsActive("RIVET2 B") = False
			LabelPLT_on_switch = False

 

 

Correct formatting, "case else" is not used (commented) and the "End if" and rest of the rule is correctly on the left side.

 

'LABEL PLATE AUTOMATIC CUSTOMER SELECTION
If LabelPLT_on_automatic = False Then
	Select Case Customer
		Case "NKT COLOGNE", "NEXANS ROGNAN"
			LabelPLT_on = "ONE FLANGE ONLY"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case "BRUGG CABLES", "HEXATRONIC", "ELCOWIRE"
			LabelPLT_on = "BOTH FLANGES"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
			'		Case Else
			'	LabelPLT_on = " NONE"
	End Select
End If

'LABEL PLATE ON/OFF
Select Case LabelPLT_on
	Case " NONE"
		Component.IsActive("LABELPLT A") = False
		Component.IsActive("LABELPLT B") = False
		Component.IsActive("RIVET1 A") = False
		Component.IsActive("RIVET2 A") = False
		Component.IsActive("RIVET1 B") = False
		Component.IsActive("RIVET2 B") = False
		LabelPLT_on_switch = False

 

 

Is this a bug or am I doing something wrong? Is there a way how I can fix the formatting?

Thank you

0 Likes

Bug iLogic rule wrong formatting with "case else"

Hi,

we are using Autodesk Inventor Professional 2022 and we are hawing problems with automated formatting of iLogic rules when we use "case else" in a rule.

See attached screenshots or the code below. This is just small part of a rule.

 

Wrong formatting, the "End If" after "End Select" and also the rest of the rule is shifted to the right which makes it very difficult to orient, I think it should be in line with the starting "If".

 

'LABEL PLATE AUTOMATIC CUSTOMER SELECTION
If LabelPLT_on_automatic = False Then
	Select Case Customer
		Case "NKT COLOGNE", "NEXANS ROGNAN"
			LabelPLT_on = "ONE FLANGE ONLY"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case "BRUGG CABLES", "HEXATRONIC", "ELCOWIRE"
			LabelPLT_on = "BOTH FLANGES"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case Else
	LabelPLT_on = " NONE"
	End Select
	End If

	'LABEL PLATE ON/OFF
	Select Case LabelPLT_on
		Case " NONE"
			Component.IsActive("LABELPLT A") = False
			Component.IsActive("LABELPLT B") = False
			Component.IsActive("RIVET1 A") = False
			Component.IsActive("RIVET2 A") = False
			Component.IsActive("RIVET1 B") = False
			Component.IsActive("RIVET2 B") = False
			LabelPLT_on_switch = False

 

 

Correct formatting, "case else" is not used (commented) and the "End if" and rest of the rule is correctly on the left side.

 

'LABEL PLATE AUTOMATIC CUSTOMER SELECTION
If LabelPLT_on_automatic = False Then
	Select Case Customer
		Case "NKT COLOGNE", "NEXANS ROGNAN"
			LabelPLT_on = "ONE FLANGE ONLY"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
		Case "BRUGG CABLES", "HEXATRONIC", "ELCOWIRE"
			LabelPLT_on = "BOTH FLANGES"
			Parameter("LABELPLT B", "Sketch_TextVisibility") = Customer
			'		Case Else
			'	LabelPLT_on = " NONE"
	End Select
End If

'LABEL PLATE ON/OFF
Select Case LabelPLT_on
	Case " NONE"
		Component.IsActive("LABELPLT A") = False
		Component.IsActive("LABELPLT B") = False
		Component.IsActive("RIVET1 A") = False
		Component.IsActive("RIVET2 A") = False
		Component.IsActive("RIVET1 B") = False
		Component.IsActive("RIVET2 B") = False
		LabelPLT_on_switch = False

 

 

Is this a bug or am I doing something wrong? Is there a way how I can fix the formatting?

Thank you

2 REPLIES 2
Message 2 of 3
Michael.Navara
in reply to: Pav3L

Michael.Navara
Advisor
Advisor

I confirm this issue.

I recommend you to use VisualStudio for iLogic rules creation. Is it possible to use my solution  iLogic for VisualStudio or ILogicRuleTester by @JelteDeJong 

0 Likes

I confirm this issue.

I recommend you to use VisualStudio for iLogic rules creation. Is it possible to use my solution  iLogic for VisualStudio or ILogicRuleTester by @JelteDeJong 

Message 3 of 3
Pav3L
in reply to: Pav3L

Pav3L
Advocate
Advocate

Ok, so this really loooks like a bug.

Where can I report it, so they can maybe fix it?

0 Likes

Ok, so this really loooks like a bug.

Where can I report it, so they can maybe fix it?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report