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: 

Custom property format default?

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
Jam_Jumpin
3211 Views, 12 Replies

Custom property format default?

parameter.jpg

 

In the parameters window you can right click a value and choose a custom property format.

 

We always change everything to fraactional instead of decimal.

Is there a way to set this as default?

12 REPLIES 12
Message 2 of 13
Xun.Zhang
in reply to: Jam_Jumpin

Hello jamjumpin,

 

Thanks a lot for your feedback, and Yes, currently, there is no way to do it automatically for new added value, but it's available for exist value by select option "Apply to existing comparable parameters" as snapshot. I try to set up a template with the option checked and try to set up API method against the issue, but failed.

 

I've filed a wish item for it in our internal system, hopefully, the issue could be fixed in the future.

 

Untitled.png


Xun
Tags (1)
Message 3 of 13
mrattray
in reply to: Xun.Zhang

Dim oParam As Parameter
Dim oParamFormat As CustomPropertyFormat

oParam = oSheetMetalCompDef.Parameters.UserParameters.Item("my parameter")
oParam.ExposedAsProperty = True
oParamFormat = oParam.CustomPropertyFormat
oParamFormat.DisplayFormat = kFractionalDisplayFormat 

 

Mike (not Matt) Rattray

Message 4 of 13
Jam_Jumpin
in reply to: mrattray

Do I just put this in a an ilogic rule on it's own to run when the document is opened?

Message 5 of 13
mrattray
in reply to: Jam_Jumpin

Well, depends on exactly what you expect. Do you want to change the format of every exported parameter, just certain parameters by name, every single parameter, do you need to create the parameter if it's not there...
I just wanted to point out that it can be done via code. I don't mind helping you implement it, too. But, I need more information first.
Mike (not Matt) Rattray

Message 6 of 13
Xun.Zhang
in reply to: Jam_Jumpin

Hello,

 

Yes, The API works for existing parameters, for new added one, user have to re-run it again manually, that's the point.


Xun
Message 7 of 13
mrattray
in reply to: Xun.Zhang

We could run a for each loop on all parameters, check it's export status and format accordingly. If he adds it to his event triggers under "before save" he could "set it and forget it".
Mike (not Matt) Rattray

Message 8 of 13

I recognize this is an old post, but I am interested in your solution. Per a previous question you asked. I would be interested in changing the format to fractional for any export value.

Message 9 of 13

Hi vintageobsoleteparts,

 

Here are the other methods.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

ParameterDisplayFormatEnum Enumerator

Description

Display format for the parameter.

 

Methods

Name Value Description
kArchitecturalDisplayFormat 92419 Architectural Display Format.
kDecimalDisplayFormat 92417 Decimal Display Format.
kFractionalDisplayFormat 92418 Fractional Display Format.
Message 10 of 13
JBerns
in reply to: Curtis_Waguespack

How would you modify the code above to format a User Parameter in a standard (not sheet metal) part?

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 11 of 13
Curtis_Waguespack
in reply to: JBerns

Hi @JBerns.

 

This should work for iLogic

 

Dim oParam As Parameter
Dim oParamFormat As CustomPropertyFormat

oParam = Parameter.Param("My_Parameter")
oParam.ExposedAsProperty = True
oParamFormat = oParam.CustomPropertyFormat
oParamFormat.Precision = Inventor.CustomPropertyPrecisionEnum.kSixteenthsFractionalLengthPrecision

related links:

https://forums.autodesk.com/t5/inventor-customization/mark-parameters-for-export/m-p/5795709/highlig...

https://forums.autodesk.com/t5/inventor-customization/custom-property-format-in-ilogic/m-p/3166376/h...

 

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

Message 12 of 13
JBerns
in reply to: Curtis_Waguespack

Hi @Curtis_Waguespack,

 

That works great! Thanks for the quick response.

 

Regards,

Jerry

-----------------------------------------------------------------------------------------
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Message 13 of 13

This works great. How could I do this to all the exported properties of all the parts in an assembly?

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

Post to forums  

Autodesk Design & Make Report