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: 

iProperty, iLogic, event trigger and Content Center

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
aurelien.berthelot
1074 Views, 3 Replies

iProperty, iLogic, event trigger and Content Center

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
3 REPLIES 3
Message 2 of 4

Maybe adding this line willl help:

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

 Write Properties you want to read.

Message 3 of 4

Damned, that's so obvious...

Thanks a lot for this simple but efficient solution.

 

Regards,

Aurelien

Message 4 of 4

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

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

Post to forums  

Autodesk Design & Make Report