Inventor Customization

Distinguished Contributor
Posts: 481
Registered: ‎08-22-2006
Message 1 of 2 (555 Views)
Accepted Solution

Find Sheet Metal Thickness with VB.Net

555 Views, 1 Replies
10-24-2012 07:47 AM

Hi guys I am looking for a solid way of finding the Thickness parameter of a sheet metal part. I have tried two ways so far:


1. oCompDef.Parameters.Item(Thickness)

This works but if Inventor is installed with a different language pack like German for instance then it fails


2. oCompDef.Parameters.Item(1).Value

This also works but if the user started the part with a normal part template and then converts the part to a sheet metal part down the line, then this method fails.


Any bright ideas?  :smileyfrustrated:


Thanks a lot guys



Distinguished Contributor
Posts: 143
Registered: ‎10-20-2001
Message 2 of 2 (550 Views)

Re: Find Sheet Metal Thickness with VB.Net

10-24-2012 08:07 AM in reply to: Raider_007

VBA - Mostly taken from an example in the help system (always the first place to look)


Public Sub GetThick()

    Dim oPartDoc As PartDocument
    Set oPartDoc = ThisApplication.ActiveDocument

    ' Make sure the document is a sheet metal document.
    If oPartDoc.SubType  "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Then
        MsgBox "A sheet metal document must be open."
        Exit Sub
    End If


    Dim oSheetMetalCompDef As SheetMetalComponentDefinition
    Set oSheetMetalCompDef = oPartDoc.ComponentDefinition


    Dim thickParam As Parameter

    Set thickParam = oSheetMetalCompDef.Thickness


End Sub

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community

Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor