iProperty, iLogic, event trigger and Content Center

iProperty, iLogic, event trigger and Content Center

aurelien.berthelot
Enthusiast Enthusiast
1,256 Views
3 Replies
Message 1 of 4

iProperty, iLogic, event trigger and Content Center

aurelien.berthelot
Enthusiast
Enthusiast

Hello, 

With a custom part publish in Content Center which contains iLogic rule:

  • the rule reads iProperties such like partnumber 
  • the rule is triggered by an event "run before save document" 

    When I place the part from the Content Center in an assembly, the rule failed because iProperties cells needed are empty. 
    It seems that the rule is launch before iProperties fill, despite the rule event trigger. 

    So how to set iLogic rule to run after iProperties writing in this case ? 
    or in over words, how to delay iLogic run to be sure that Inventor system has finished iProperties cells fill ? 

    Thank for your help
     
    Aurelien
0 Likes
Accepted solutions (1)
1,257 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Accepted solution

Maybe adding this line willl help:

If iProperties.Value("Custom", "PropertyName")="" Then Exit Sub

 Write Properties you want to read.

0 Likes
Message 3 of 4

aurelien.berthelot
Enthusiast
Enthusiast

Damned, that's so obvious...

Thanks a lot for this simple but efficient solution.

 

Regards,

Aurelien

0 Likes
Message 4 of 4

Anonymous
Not applicable

I think my problem may be related. I am trying to have an iLogic message box pop up after I have selected the size from the content centre options list and before I am prompted to save. I want to do this because I want to enter a custom parameter which I want to be included as a prefix to the filename before being prompted to save. 

See my code below:

I want to be able to enter PR NUMBER before being asked to save. Then one the iProperty "Part Number" has populated, I want to be propted to safe the file as the string produced in "Part Number"

The underlying question is.. how can I get the iLogic rule message box to pop up before I am asked to save?

 

Dim propertyName1 As String = "PR Code"

'define custom prp[erty collectionoCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")

Try
'set property valueoProp = oCustomPropertySet.Item(propertyName1)
Catch
' Assume error means not found so create itoCustomPropertySet.Add("", propertyName1)
End Try

Dim strPRCode As String

'get values from userstrPRCode = InputBox("Enter the PR NUMBER.", "PARENT", "") 'no default value

'set custom property valuesiProperties.Value("Custom", "PR NUMBER") = strPRCode
iProperties.Value("Project", "Part Number") = iProperties.Value("Custom", "PR NUMBER") &"_"& iProperties.Value("Project", "Stock Number")

iLogicVb.UpdateWhenDone = True
0 Likes