ilogic and custom iproperties

ilogic and custom iproperties

tuanvan3575
Participant Participant
336 Views
1 Reply
Message 1 of 2

ilogic and custom iproperties

tuanvan3575
Participant
Participant

I have a rule to add a custom iPropteries "small" if either width or length of a part is > 1.5 and < 6.

iLogicVb.UpdateWhenDone = True

Dim pLength As Decimal = width
Dim pWidth As Decimal = length

'Dim pLength As Decimal = Measure.ExtentsLength'Dim pWidth As Decimal = Measure.ExtentsLength

'define custom property collection'oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")'look at each property in the collection'For Each oCustProp In oCustomPropertySet'check for a property name that you don't want to delete'If oCustProp.Name = "small" Then'delete the custom iProperty'oCustProp.Delete'Else'End If'Next


If pLength > 1.5 And  pLength < 6 Then
    iProperties.Value("Custom", "small") = "yes"
Else If pWidth > 1.5 And  pLength  < 6 Then
    iProperties.Value("Custom", "small") = "yes"
Else
    iProperties.Value("Custom", "small") = "no"
End If

RuleParametersOutput()
InventorVb.DocumentUpdate()

 It doesn't work if I change the rule to

Dim pLength As Decimal = Measure.ExtentsLength
Dim pWidth As Decimal = Measure.ExtentsLength

I have to run rule after change the parameter to have iProperties updated. Is there a way to update iProperties without run or regenerate the rule?

 

Thanks,

Tuan

0 Likes
337 Views
1 Reply
Reply (1)
Message 2 of 2

rjay75
Collaborator
Collaborator

This is because while using the Measure options theres no parameters in the rule changing to automatically run the rule. Set an event trigger to run the rule before save.

 

Also since there are no parameters in the rule the document updating and outputting the parameters can be removed.

0 Likes