- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I use an Ilogic I use a rule to check if a list "MY LIST" exists in my parts and assemblies files.
I use the trigger to lunch that rules before .ipt and .iam are saved. With parts and assemblies the rules work well. But If I save some modifications on .ipt or .iam from a drawing (.idw) I have this error.
Message error: (sorry for the "french")
Erreur de règle: TypeERPListeDéroulante, dans le document 117994.iam
Le membre public 'ComponentDefinition' du type 'DrawingDocument' est introuvable.
I think it's come from this line of the code (full rule is below)
oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters
When I save from the idw the active document is a idw and not an iam or ipt.
Normally the code should not run in the idw.
I think saving the .ipt/.iam runs the rule but it runs at the idw level.
I don't know how can i get around the problem.
Do you have any ideas?
Thanks a lot for your time 🙂
Dim FileName As String FileName = ThisDoc.FileName() If FileName <> "" Then oMyParameter = ThisApplication.ActiveDocument.ComponentDefinition.Parameters.UserParameters Try otester = oMyParameter.Item("Liste_TypeERP") Catch oInsulationType = oMyParameter.AddByValue("Liste_TypeERP", "", UnitsTypeEnum.kTextUnits) 'make parameter a multivalue list parameter MultiValue.SetList("Liste_TypeERP", "Machine", "Dont export to ERP", "Part or sub assembly", "Purchase", "Ghost") End Try
Solved! Go to Solution.