- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I have a problem with an ilogic that is called from an add-inn.
We are using an add-inn (not made by me) that executes an ilogic named "start" when the inventor file is saved.
doc = ThisDoc.Document
oDoc = ThisApplication.ActiveDocument
Dim docType As DocumentTypeEnum = doc.DocumentType
' docSubType As String = doc.SubType
Dim docSubType As String = oDoc.SubType
Select Case docType
Case DocumentTypeEnum.kAssemblyDocumentObject
'IAM
iLogicVb.RunExternalRule("MassProperty")
iLogicVb.RunExternalRule("DisplayName")
Case DocumentTypeEnum.kDrawingDocumentObject
'idw/dwg
'iLogicVb.RunExternalRule("DisplayName")
iLogicVb.RunExternalRule("Mass Drawing")
iLogicVb.RunExternalRule("UpdateDrwResources")
'iLogicVb.RunExternalRule("update_drawing_rcsrcs_for_new_drw")
Case DocumentTypeEnum.kPartDocumentObject
'ipt
iLogicVb.RunExternalRule("DisplayName")
iLogicVb.RunExternalRule("MassProperty")
iLogicVb.RunExternalRule("MaterialGrade")
If docSubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"
'Sheet Metal
iLogicVb.RunExternalRule("SheetMetalExtents")
Else If docSubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}"
' "Vanlig" part
iLogicVb.RunExternalRule("PartExtents")
End If
End Select
In case it is a drawing the ilogic "Start" fires up an iLogic named "UpdateDrwRecources".
When I execute the ilogic "Start" through our add-inn (by saving the drawing) the iLogic "UpdateDrwRecources" will be found and executed but not in a sufficient way. I can see by using message boxes in that iLogic "UpdateDrwRecources" that it is executed but it is also supposed to delete drawing borders and replace those with latest from the drawing template...which is not happening.
But when I execute the iLogic "Start" manually from the external iLogic tab, everything is working as supposed.
Is it possible that certain operations within the iLogic (like deleting borders) is not possible when executed initially by the ad-inn?
(I know it is a quite nested logic and could be probably done in better way but here it is set-up like this at the moment.)
Solved! Go to Solution.