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: 

How to customize 'Custom Property Format' window?

5 REPLIES 5
Reply
Message 1 of 6
shah_falgun
511 Views, 5 Replies

How to customize 'Custom Property Format' window?

I use the value of parameters (i.e. value of Length or width) in the iproperties thru expressions. This iproperty, I reflect to my drawing file. This always gives me the updated value.

 

By default, all the value gets 'in' as a units string after their value. Whereas our drawing does not need to show 'in' but ' " ' inch symbol.

 

Is there a way that I can change the default for the units string?

Custome property format.JPG

5 REPLIES 5
Message 2 of 6

Hi,

 

I do not know if product has an option to change the default value. But API provides Parameter.CustomPropertyFormat  for each parameter, which could be used to control over how the parameter value is formatted when it is exposed as a custom iProperty. Hope it helps.

 

Regards,

Xiaodong Liang

Developer Technical Services

Message 3 of 6

Can you please provide the steps how to do this? As I never use Inventor VB to customize. Thanks!

Message 4 of 6

Hi,

 

The Parameter.CustomPropertyFormat  is NOT to customize the default value of the UI dialog [Custom Property Format]. Instead, it is to set the format directly. e.g.

 

Assume we want to set the ShowLeadingZeros  = true for all custom param. A small VBA macro would be like:

 

Sub SetPropertyFormat()

 

  Dim oDoc As PartDocument

  Set oDoc = ThisApplication.ActiveDocument

 

  Dim oParams As Parameters

  Set oParams = oDoc.ComponentDefinition.Parameters

 

  Dim oP As Parameter

  For each oP in oParams

     If oP. ExposedAsProperty Then

        oP. CustomPropertyFormat. ShowLeadingZeros = True

     End If

Next

End Sub

 

Hope this makes sense.

 

Regards,

Xiaodong Liang

Developer Technical Services

Message 5 of 6

If i understand correctly, you are saying that Custom property default can not be changed. But by making small macro, it will change the unit string instead of doing manually all the time.

 

As I mentioned previously, I never made macro using VBA and no knowledge of how to program it. The example you have given, does it apply to all the files or one particular file only and do I have to run macro manually?

 

By the way, can you please suggest books or documents for making macros and using VBA for Inventor for beginners?

 

Thanks!

Message 6 of 6

Hi,

 

Sorry for my late response.

  

Yes, what i meant is if you write a macro, you would be able to change ''Custom Property Format' by code. I thought you can program, so my code snippet is a very small demo. It just applies to current document. But it would be not difficult to apply it to all documents, even batch processing. However, this depends on your requirement.

 

As to the materials to learn API, I recommend:

 

1. the webcast recording at

http://www.adskconsulting.com/adn/cs/api_course_webcast_archive.php

 

2. AU class:

http://au.autodesk.com/?nd=class&session_id=2818

 

3. Brian’s blog (there is some articles on basic knowledges)

http://modthemachine.typepad.com  

 

 

Regards,

Xiaodong Liang

Developer Technical Services

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

Post to forums  

Autodesk Design & Make Report