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
Solved! Go to Solution.
Solved by WCrihfield. Go to Solution.
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
(Not an Autodesk Employee)
Can't find what you're looking for? Ask the community or share your knowledge.