Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Change user parameter custom property format for multiple cc families

3 REPLIES 3
Reply
Message 1 of 4
mat_hijs
317 Views, 3 Replies

Change user parameter custom property format for multiple cc families

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.

3 REPLIES 3
Message 2 of 4
Michael.Navara
in reply to: mat_hijs

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...

 

Message 3 of 4
mat_hijs
in reply to: Michael.Navara

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?

Message 4 of 4
Michael.Navara
in reply to: mat_hijs

This is not possible with (documented) code. Sorry ☹️

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report