Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Jakob_Hamburg
in reply to: WCrihfield

Hi @WCrihfield

Thank you very much for your explanations.

I am running these iLogic "before" save.

You are totally right with the mess in my iLogic rules...(I inherited those rules and try not touch too much since they are running..but only running until I have to make some modification due to new requirements.)

I updated the iLogic "Start" but that is not the cause of the problem, I think.

'Dim oDoc As Document = ThisDoc.Document
Dim oDoc As Document = ThisApplication.ActiveDocument

Dim docType As DocumentTypeEnum = oDoc.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.Automation.RunExternalRule(oDoc,"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
	

 

The ilogic "Start" fires up an iLogic named "UpdateDrwRecources". And that "UpdateDrwRecources" is working differntly based on how it is executed. 

We have an add-in that executes "before save" the ilogic "Start". When the (external) ilogic is executed manually instead by "run rule" it acts as it should. 

(I will describe the behaviour in a few minutes)