Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
InventorMan1
3157 Views, 8 Replies

Create a Ribbon Button to run iLogic

Hi,

 

I'm not too familiar with VBA but I have been using iLogic in order to set up some basic data on some part/assembly-files. I cannot create myself a different template, as my company restricts this.

 

Thing I need:
 - New custom iProperties. I've been using iProperties.Value-snippet.

 - New parameters, with certain formatting. For this i have used iLogic, shown below:

 

doc = ThisDoc.Document 'Defining document and providing access to parameters on different levels.

Dim oPartCompDef As PartComponentDefinition = doc.ComponentDefinition

Dim oParams As Parameters = oPartCompDef.Parameters

Dim oUserParams As UserParameters = oParams.UserParameters

 

oUserParams.AddByValue(“XXX_LENGTH”, 0, “mm”) 'Creating needed XXX-parameters.

 

oLength = Parameter.Param("XXX_LENGTH") 'Defining Custom Properties for parameter

oLength.ExposedAsProperty = True

oFormat=oLength.CustomPropertyFormat

oFormat.PropertyType=Inventor.CustomPropertyTypeEnum.kTextPropertyType

oFormat.Precision=Inventor.CustomPropertyPrecisionEnum.kZeroDecimalPlacePrecision

 

My question is, how could I create a button to my Inventor ribbon, that could run these kind of iLogic codes?

 

-Ossi