Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How do I upload custom property format of parameter in FX to other files

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
ErikvRy
181 Views, 2 Replies

How do I upload custom property format of parameter in FX to other files

ErikvRy
Contributor
Contributor

Hi all,

 

Thanks for reading.

 

I have changed the property format setting of the Nominal value in FX to a custom proppertu format. See prtscrn below. If you right click in the fx parameterfield you want to change, you get a pop up with the option to change to custom property format. And then the window you see on the left in that prtscrn.

 

To be more precise: I removed the trailing zero's as more precision than mm² is not a necessity, and with trailing zero's it does not fit into our title block.

 

Now I want to change that parameter format, in all other file's as well. How do I do that?

 

Please make the sollution look difficult, or I feel stupid.... (Not really) Thanks.

 

Erik.

 

0 Likes

How do I upload custom property format of parameter in FX to other files

Hi all,

 

Thanks for reading.

 

I have changed the property format setting of the Nominal value in FX to a custom proppertu format. See prtscrn below. If you right click in the fx parameterfield you want to change, you get a pop up with the option to change to custom property format. And then the window you see on the left in that prtscrn.

 

To be more precise: I removed the trailing zero's as more precision than mm² is not a necessity, and with trailing zero's it does not fit into our title block.

 

Now I want to change that parameter format, in all other file's as well. How do I do that?

 

Please make the sollution look difficult, or I feel stupid.... (Not really) Thanks.

 

Erik.

 

Labels (2)
2 REPLIES 2
Message 2 of 3
pcrawley
in reply to: ErikvRy

pcrawley
Advisor
Advisor
Accepted solution

You're not stupid - it's a good question.  As far as I know, there isn't a button for that - unless the formatting is available from the API, in which case a couple of lines of iLogic would do the trick.  (I will have to look!)

(Edit: I looked. It is.)

 

You could set the formatting in your part template - then all future parts will behave correctly. 

Fixing parts from the past may be as difficult as you are hoping.

Peter

You're not stupid - it's a good question.  As far as I know, there isn't a button for that - unless the formatting is available from the API, in which case a couple of lines of iLogic would do the trick.  (I will have to look!)

(Edit: I looked. It is.)

 

You could set the formatting in your part template - then all future parts will behave correctly. 

Fixing parts from the past may be as difficult as you are hoping.

Peter
Message 3 of 3
pcrawley
in reply to: ErikvRy

pcrawley
Advisor
Advisor
Accepted solution

Try this.  Reading the code should show how you can tweak it, but I made it look specifically for your parameter called "Oppervlakte".  Feel free to edit 🙂

 

For Each oParameter In oPartDoc.ComponentDefinition.Parameters.UserParameters
	If oParameter.ExposedAsProperty Then
		If oParameter.Name = "Oppervlakte" And oParameter.Units = "mm" Then
			 oFormat = oParameter.CustomPropertyFormat
			 oParameter.ExposedAsProperty = True
			 oFormat.PropertyType = Inventor.CustomPropertyTypeEnum.kTextPropertyType
			 oFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision
			 oFormat.Units = "mm"
			 oFormat.ShowUnitsString = False
			 oFormat.ShowLeadingZeros = True
			 oFormat.ShowTrailingZeros = False 
		 End If
	 End If
Next oParameter

 

Peter

Try this.  Reading the code should show how you can tweak it, but I made it look specifically for your parameter called "Oppervlakte".  Feel free to edit 🙂

 

For Each oParameter In oPartDoc.ComponentDefinition.Parameters.UserParameters
	If oParameter.ExposedAsProperty Then
		If oParameter.Name = "Oppervlakte" And oParameter.Units = "mm" Then
			 oFormat = oParameter.CustomPropertyFormat
			 oParameter.ExposedAsProperty = True
			 oFormat.PropertyType = Inventor.CustomPropertyTypeEnum.kTextPropertyType
			 oFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision
			 oFormat.Units = "mm"
			 oFormat.ShowUnitsString = False
			 oFormat.ShowLeadingZeros = True
			 oFormat.ShowTrailingZeros = False 
		 End If
	 End If
Next oParameter

 

Peter

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

Post to forums  

Autodesk Design & Make Report