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: 

iLogic Rule is not populating custom Parameters

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Shag_Bore
162 Views, 1 Reply

iLogic Rule is not populating custom Parameters

I have a rule that I am trying to manipulate around the randomness of the flat pattern, My other post here

 

I have added 2 place holder parameters called TEMP_EXTENTS_LENGTH and TEMP_EXTENTS_WIDTH, these are populated from the snippets in the sheetmetal area. 

 

I created a simple greater than less than rule to give me a result so the the longer edge would then populate the custom parameter EXTENTS_LENGTH and the shorter edge would populate the EXTENTS_WIDTH parameter. This seems like a lot of extra work but if you read the linked post, for some reason the flat pattern changes when altering the part and I want my parts lists to display the longest edge as length.

 

Here is the code, there are no errors, however there are no results or changes, the EXTENTS_LENGTHS and EXTENTS_WIDTHS parameters remain unchanged. 

 

TEMP_EXTENTS_LENGTH = SheetMetal.FlatExtentsLength
TEMP_EXTENTS_WIDTH = SheetMetal.FlatExtentsWidth

x = TEMP_EXTENTS_LENGTH
y = TEMP_EXTENTS_WIDTH


If x > y Then 

EXTENTS_LENGTH = SheetMetal.FlatExtentsLength &  EXTENTS_WIDTH = SheetMetal.FlatExtentsWidth 

ElseIf x < y Then 

EXTENTS_LENGTH = SheetMetal.FlatExtentsWidth  &  EXTENTS_WIDTH = SheetMetal.FlatExtentsLength 

End If
Sean Farr
Product Designer at Teksign Inc.
Inventor 2016 SP1
Dell Precision 3660
i7-12700 @ 2.40GHz-4.90GHz
32GB DDR5 4400MHz RAM
NIVDIA RTX A2000 6GB
1 REPLY 1
Message 2 of 2
WCrihfield
in reply to: Shag_Bore

Hi @Shag_Bore.  Your code appears to be formatted incorrectly.  You only use the '&' symbol for piecing together sections of a String, not for consecutively setting values to numerical values.

This is how it should be formatted.

TEMP_EXTENTS_LENGTH = SheetMetal.FlatExtentsLength
TEMP_EXTENTS_WIDTH = SheetMetal.FlatExtentsWidth

x = TEMP_EXTENTS_LENGTH
y = TEMP_EXTENTS_WIDTH

If x > y Then 
	EXTENTS_LENGTH = SheetMetal.FlatExtentsLength
	EXTENTS_WIDTH = SheetMetal.FlatExtentsWidth 
ElseIf x < y Then 
	EXTENTS_LENGTH = SheetMetal.FlatExtentsWidth
	EXTENTS_WIDTH = SheetMetal.FlatExtentsLength 
End If

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report