Autodesk Inventor Customization
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
163 Views, 6 Replies
01-19-2013 10:57 AM
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2013 03:52 AM in reply to:
Vitornis
Hello
You can set these formats like this:
Dim oUserParameter As UserParameter oUserParameter = oInvApp.ActiceDocument.Parameters.UserParameters.Item(1) oUserParameter.ExposedAsProperty = True oUserParameter.CustomPropertyFormat.Precision = CustomPropertyPrecisionEnum.kDegreesAnglePrecision oUserParameter.CustomPropertyFormat.PropertyType = CustomPropertyTypeEnum.kTextPropertyType oUserParameter.CustomPropertyFormat.ShowTrailingZe ros = True oUserParameter.CustomPropertyFormat.ShowUnitsStrin g = False
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2013 05:36 PM in reply to:
krieg
How do you change the format to fractional?
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-20-2013 10:32 PM in reply to:
Vitornis
Hello
Define the correct type of precision-property
Private Sub fxex() Dim oInvApp As Application Set oInvApp = ThisApplication Dim oUserParameter As UserParameter Set oUserParameter = oInvApp.ActiveDocument.ComponentDefinition.Parameters.UserParameters.Item(1) oUserParameter.ExposedAsProperty = True oUserParameter.CustomPropertyFormat.PropertyType = CustomPropertyTypeEnum.kTextPropertyType oUserParameter.CustomPropertyFormat.Precision = CustomPropertyPrecisionEnum.kSixteenthsFractionalL engthPrecision oUserParameter.CustomPropertyFormat.Units = UnitsTypeEnum.kInchLengthUnits oUserParameter.CustomPropertyFormat.ShowUnitsStrin g = False End Sub
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-23-2013 06:16 PM in reply to:
krieg
oooo Thanks!
Now i see what i was missing!
What is a good resource for writing these VBA macros?
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-24-2013 10:28 PM in reply to:
Vitornis
Hello
Happy it works. ![]()
The best three sources are:
- Autodesk Inventor programmers help (included in pulldown menu in every inventor installation)
- Internet
- watch window in VBA-Editor to step through the object model tree
Re: How can i make these custom property formats with VBA?
Options
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
01-29-2013 03:43 PM in reply to:
krieg
Exactly kreig,
I prefer first and third options.... VBA Help is fantastic and watch window will tell all of the info in referenced Doc.
Cheers
Mechanical Engineer
Inventor Applications Engineer
--------------------------------------------------------------------------------------
If my solution seems to remedy your problem, please press the Accept Solution button, Some KUDOS -
-------------------------------------------------------------------------------------
Inventor Applications Engineer
--------------------------------------------------------------------------------------
If my solution seems to remedy your problem, please press the Accept Solution button, Some KUDOS -
-------------------------------------------------------------------------------------
