I have multiple content center families in which I want to change the custom property format of a user parameter "Lengte" from Text to Number. Is there a way to do this for multiple families without having to open each family, changing it and replacing the family template? Doing it that way would take a lot more time than I would like it to do.
If you don't want to change family template, you can create simple external iLogic rule and run it before save document. You can check if the document is from content center and if it has parameter "Lengte". In this case you can change the parameter setting as you want.
Be careful to modify document if it is not necessary (set property to the same value).
Dim partDoc As PartDocument = ThisDoc.Document
Dim p As Inventor.Parameter
Try
p = partDoc.ComponentDefinition.Parameters("Lengte")
Catch
'Parameter not found
Return
End Try
If p.ExposedAsProperty = False Then p.ExposedAsProperty = True
Dim f As CustomPropertyFormat = p.CustomPropertyFormat
If f.PropertyType <> CustomPropertyTypeEnum.kNumberPropertyType Then f.PropertyType = CustomPropertyTypeEnum.kNumberPropertyType
If f.Units <> "mm" Then f.Units = "mm"
'etc...
Well, I would actually like to change the family template. But I don't want to manually do it for every family. Do you know if this would somehow be possible with code?
This is not possible with (documented) code. Sorry ☹️
Can't find what you're looking for? Ask the community or share your knowledge.