BOM base qty as FlatPatternExtents for Sheet Metal Parts

BOM base qty as FlatPatternExtents for Sheet Metal Parts

emanuel.c
Collaborator Collaborator
251 Views
3 Replies
Message 1 of 4

BOM base qty as FlatPatternExtents for Sheet Metal Parts

emanuel.c
Collaborator
Collaborator

In the snippet below is a Part List which is grouped by GS Stock Number. Then I get the total quantities under the QTY column. Each part has it's Bill of Materials Base Quantity set accordingly - that is found in Tools -> Options -> Document Setting -> Bill of Materials.

 

Capture.JPG

 

The issue I have is with Sheet Metal Parts. It would be the parts 501, 502, 503 in this example. (Yes in this case they're actually UHMW parts, but I need their areas so they're drawn as Sheet Metal parts). Can I show the sheet metal parts area under the QTY a little better? I wish it to be square feet, instead of inches. To get the values I have there I created a parameter "Extents" which I write with the little ilogic code here. But parameters can't have areas and I'm not sure if there is a way to get Base Quantity to show as area.

 

Does anybody have an idea on this? Thank you much!

 

Dim smlength As Double
Dim smwidth As Double
Dim oSMthk As Double = Parameter("Thickness")
smlength = (SheetMetal.FlatExtentsLength + oSMthk) / 2.54 'added part thickness for cut kerf and divide cm to inches
smwidth = (SheetMetal.FlatExtentsWidth + oSMthk) /2.54
Dim Area As Double = smlength * smwidth / 144 'given in sq ft
Parameter("Extents") = format(Area, "0.00")

 

0 Likes
252 Views
3 Replies
Replies (3)
Message 2 of 4

WCrihfield
Mentor
Mentor

Hi @emanuel.c.  Actually UserParameter's can be for Area.  The units are just a bit tricky to specify, but they do stick / take if specified properly.  For area in inches squared, you can set the Units to "in^2" or "in in", and for feet squared you can use "ft^2" or "ft ft".

Here is a simple example of creating an Area type user parameter, and setting its value (using its Expression in this case) to 25 feet squared.

Dim oPDoc As PartDocument = ThisDoc.Document
oUParams = oPDoc.ComponentDefinition.Parameters.UserParameters
oName = "Area1"
oExpression = "25 ft^2"
Dim oMyUParam As UserParameter = Nothing
For Each oUParam As UserParameter In oUParams
	If oUParam.Name = oName Then
		oMyUParam = oUParam
		Exit For
	End If
Next
If oMyUParam Is Nothing Then
	oMyUParam = oUParams.AddByExpression(oName, oExpression, "ft^2")
Else
	oMyUParam.Expression = oExpression
End If

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS 💡 or you can Explore My CONTRIBUTIONS

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 4

emanuel.c
Collaborator
Collaborator

Hi Wesley, thanks for that. I didn't know you can type in "ft^2" in the Parameters -> Units. That works great.

But can I have that carry though to the BOM Base Quantity Type to the Parts List QTY column?

0 Likes
Message 4 of 4

WCrihfield
Mentor
Mentor

I honestly don't recall right now.  It sure seems like it should be possible.  But even after creating user parameters for Length, Width, Area in my sheet metal part, and setting each one to Key, and Export, I still don't see the Area one listed to choose from within the DocumentSettings > Bill Of Materials tab > Base Quantity drop down.  I do see the Length & Width ones there though.  It seems to me like in a previous attempt at something like this, we may have had to 'spoof' the parameter somehow to get this to work.  Something like setting the parameter's units to Unitless or regular Inches, then we would just have to keep in mind how to 'interpret' that parameter's units in other situations.  It did not seem like a very ideal or simple solution.  I think I was attempting to deal with Mass in that other situation though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes