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

Correct,...

If I Resume the workflow of the video example Code.

The Code in Assembly, Calling Local rule from The Part Or Sub-Assembly, Which Part Selected.

Where is the Local rule Calling to Open Local Form The Part Or Sub-Assembly.

*Be care full  ***Form***&***From***

 

Sorry, My Next Question. 

If I have Just Only 1 Form. In-Sub Assembly or Part but Potential with Deferent Name. If I work in Assembly Which have Many Sub Assembly or Part. 

should I Add a Rule Named "Show Form" in Each Part or Each Sub-Assembly To Open Form in Assembly?  

 

I Drop The Example Video Code

 

'Check Whether Open Document is an assembly And Exit Rule If Not
oDoc = ThisDoc.ModelDocument
If oDoc.DocumentType = kPartDocumentObject Then
MessageBox.Show ("This rule can only be run in an assembly file - exiting rule", "Excitech i-Logic")
Return
End If

Dim targetOcc As ComponentOccurrence = Nothing
Do While True
	targetOcc = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAssemblyOccurrenceFilter, "Select Sub-Assembly Or Part to Modify... (Press ESC to Cancel)")
	If Not targetOcc Is Nothing Then
		Exit Do
	else
		Dim Res As MsgBoxResult = MsgBox("No Sub-Assembly Selected - Exit?",36, "Excitech i-Logic")
		If Res = vbYes Then
			Return
		Else
			'Do Nothing-Keep On Looping
		End If
	End If
Loop

Try
iLogicVb.RunRule(targetOcc.Name, "Show Form") 'Show Form is Your rule in Part to Open Form Part or Sub-Assembly
Catch
MessageBox.Show ("There needs to be a rule called 'Show Form' in the Part Or Sub-Assembly to Run Their Local Form", "Excitech i-Logic")
End Try