Can I remove the Event Trigger included in the file with i-Logic?

Can I remove the Event Trigger included in the file with i-Logic?

skseo
Contributor Contributor
365 Views
5 Replies
Message 1 of 6

Can I remove the Event Trigger included in the file with i-Logic?

skseo
Contributor
Contributor

i-Logic에서 파일에 포함된 이벤트를 제거할 수 있습니까?

캡처.PNG

 

0 Likes
Accepted solutions (3)
366 Views
5 Replies
Replies (5)
Message 2 of 6

WCrihfield
Mentor
Mentor

Hi @skseo.  Yes.  It is possible to do that by iLogic.  However, I can't read most of the text shown within the image you posted, so I don't know what Event the rule is under, or what the name of the rule is, so I would not be able to write code for you to remove one specific rule from one specific event.  I assume that the tab being used in that dialog is the one named "This Document", since it appears to be the last tab on the right, is that correct?  The settings on that one tab are being stored in a hidden iProperty set within the document, that can only be accessed through its correct name directly, not by looping through all property sets.  The settings on the other tabs of that dialog are stored in an external XML file, and are not as easy to manipulate with an iLogic rule.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 6

skseo
Contributor
Contributor

관심가져주셔서 감사합니다.
이미지는 단순히 기능에 대해 설명하고자 넣어둔 것입니다.
포럼을 올린 목적은 iLogic을 사용해서 ipt파일 자체에 설정되어 있는 이벤트 트리거를 모두 삭제하고 싶습니다.

 

Thank you for your interest.
The image is simply a description of the function.
The purpose of the forum is to use iLogic to delete all event triggers set in the ipt file itself.

0 Likes
Message 4 of 6

JelteDeJong
Mentor
Mentor
Accepted solution

You could try something like this:

Dim doc As Document = ThisDoc.Document

Dim iLogicPropSet As PropertySet
Try
	iLogicPropSet = doc.PropertySets.Item("{2C540830-0723-455E-A8E2-891722EB4C3E}")
Catch
	Return
End Try

For Each prop As [Property] In iLogicPropSet
	logger.Info($"{ prop.Name} -> {prop.Value.ToString()}")
	prop.Delete()
Next

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 5 of 6

bradeneuropeArthur
Mentor
Mentor
Accepted solution

@JelteDeJong 

Or remove the propertyset complete!

iLogicPropSet = doc.PropertySets.Item("{2C540830-0723-455E-A8E2-891722EB4C3E}")
iLogicPropSet.delete

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 6 of 6

WCrihfield
Mentor
Mentor
Accepted solution

Thanks for taking care of this one over the weekend guys.  I am usually not active on the forums during weekends.  There is one little thing that I would like to add here though, just to simplify it a bit.  The Try...Catch block of code is not needed, because there is actually already a built-in Function for getting the PropertySet, even if it might not exist, without throwing any errors, and due to how the code would be formatted to use that function, the deletion portion of the code could simply be nested within the check for the PropertySet.  Below is the simplest example.

Dim oSet As PropertySet
If ThisDoc.Document.PropertySets.PropertySetExists("{2C540830-0723-455E-A8E2-891722EB4C3E}", oSet) Then
	oSet.Delete
End If

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes