Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Anonymous
in reply to: Anonymous

That helped? Thanks!  Here is the final code in case others have a similar issue.

 

 

 

Public Sub SetParameterFormatToSixteenthsFractional()

    'Get the active assembly document.
    Dim oAsmDoc As AssemblyDocument
    Set oAsmDoc = ThisApplication.ActiveDocument

    'Iterate through all of the documents referenced by the assembly.
    Dim oDoc As Document
    For Each oDoc In oAsmDoc.AllReferencedDocuments
    
        'Check to see if this is a part.
        If oDoc.DocumentType = kPartDocumentObject Then
        
            Debug.Print oDoc.FullFileName
        
            Dim oPartDoc As PartDocument
            Set oPartDoc = oDoc
            
            Dim oUserParams As UserParameters
            Set oUserParams = oPartDoc.ComponentDefinition.Parameters.UserParameters
            
            'Check to see if the part document contains user parameters.
            If oUserParams.Count > 0 Then
            
                Dim oUserParam As UserParameter
                
                'Loop through each user paramter.
                For Each oUserParam In oUserParams
                
                    'look for user parameter G_L.
                    If oUserParam.Name = "G_L" Then
                    
                        Debug.Print oUserParam.Name
                        Set oUserParam = oUserParams.Item("G_L")
                        oUserParam.CustomPropertyFormat.Precision = kSixteenthsFractionalLengthPrecision
                       
                    End If
    
                Next oUserParam
                
            End If
            
        End If
        
    Next oDoc
    
End Sub