Hi @Luis_Pacheco_3D. I wasn't sure if your assembly included any sub-assemblies or not, or if you wanted them to be processed, or if you only wanted just the actual parts only to be effected, or how many levels down you wanted this code to effect, so I just set it up to attempt to process 'all referenced documents' of the main assembly. That will encompass all sub-assemblies and all parts at all levels of the assembly. I used a separate Sub routine to do the bulk of the work, to leave the main Sub cleaner and shorter.
This iLogic rule should do the trick.
Sub Main
If ThisApplication.ActiveDocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
MsgBox("An Assembly Document must be active for this rule to work. Exiting.",vbCritical, "WRONG DOCUMENT TYPE")
Exit Sub
End If
Dim oADoc As AssemblyDocument = ThisApplication.ActiveDocument
SetParamProps(oADoc, "Height")
SetParamProps(oADoc, "Width")
For Each oRefDoc As Document In oADoc.AllReferencedDocuments
SetParamProps(oRefDoc, "Height")
SetParamProps(oRefDoc, "Width")
Next
End Sub
Sub SetParamProps(oDoc As Document, oParamName As String)
If Not (TypeOf oDoc Is PartDocument) And Not (TypeOf oDoc Is AssemblyDocument) Then Exit Sub
For Each oParam As Inventor.Parameter In oDoc.ComponentDefinition.Parameters
If oParam.Name = oParamName Then
If Not oParam.ExposedAsProperty Then
oParam.ExposedAsProperty = True
End If
Try
oParam.CustomPropertyFormat.Precision = CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision
Catch oEx As Exception
'MsgBox(oEx.Message & vbCrLf & oEx.StackTrace,,"")
End Try
End If
Next
End Sub
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

(Not an Autodesk Employee)