• Blog posts


    by Clint Brown

    I was asked recently if it is possible to extract the extents of a flat pattern, and write the sizes to back to either a Custom iProperty or Parameter. The idea is that this will give the user a "blank" size, which could be listed in a BoM, and could be used for costing etc.

    The Code itself was pretty easy to put together, as I have previously done some work on sheet metal components (see link in the code), so it was pretty much a job of re-purposing some older code. What seemed like the trickiest part was understanding the Length Width and Thickness, and figuring out  how to correctly assign these to the correct Parameter or iProperty, I've explained this in the video below, and as you will see, it's pretty straightforward.

    The idea here, is to paste this code into your Sheet metal template, and to run it once you have completed your model.

    Note that the Parameter code is Commented out in this example, so this code only writes back to the iProperties, if you create the parameters and un-comment the 3 lines referencing the parameters, the code will write back to these.

    Please test it out and let me know if you find it useful.

    The Code is available by downloading the attached PDF.




  • Avatar
    Anna Nowak

    I have simple rule doing similar job:

    On Error Resume Next
    iProperties.Value("Custom", "Width") = Round(SheetMetal.FlatExtentsWidth, 2)
    iProperties.Value("Custom", "Length") = Round(SheetMetal.FlatExtentsLength, 2)
    iProperties.Value("Custom", "Area") = Round(SheetMetal.FlatExtentsArea * 0.000001, 3)
    iProperties.Value("Custom", "Weight") = Round(iProperties.Mass, 3)
    iProperties.Value("Custom", "Thickness") = Round(Thickness, 1)


  • Avatar
    David Olsson

    Same here Anna, Short and works perfect :)
    'Go to flat pattern and measure & write to custom properties
    Length = SheetMetal.FlatExtentsLength
    Width = SheetMetal.FlatExtentsWidth

    'Go back to folded view and update document
    Dim oDoc As PartDocument
    oDoc = ThisApplication.ActiveDocument

    Dim oSMDef As SheetMetalComponentDefinition
    oSMDef = oDoc.ComponentDefinition

Please sign in to leave a comment.