Event Triggers Iproperties change on single iproperties

Event Triggers Iproperties change on single iproperties

Darkforce_the_ilogic_guy
Advisor Advisor
772 Views
9 Replies
Message 1 of 10

Event Triggers Iproperties change on single iproperties

Darkforce_the_ilogic_guy
Advisor
Advisor

I would like to know if it is possible  to  make an event triggers  with a special Iproperties are change.

 

I want to run a code when Surface is change .. it is a custom properties I iproperty.... but I do not want it to run ever times that someone make a change to any other iproperties.

 

 

how can I do this ?

0 Likes
773 Views
9 Replies
Replies (9)
Message 2 of 10

bradeneuropeArthur
Mentor
Mentor
Sub AddHandlers()
    Dim oDoc As Inventor.Document = invApp.ActiveDocument
    AddHandler oDoc.DocumentEvents.OnChange, AddressOf Me.ChangeSub
End Sub

Sub ChangeSub(ReasonsForChange As CommandTypesEnum, BeforeOrAfter As EventTimingEnum, Context As NameValueMap, HandlingCode As HandlingCodeEnum)
    
    If ReasonsForChange = CommandTypeEnum.kFilePropertyEditCmdType Then
          ' Do something cool
    End If

End Sub

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

0 Likes
Message 3 of 10

do not understand how it work .. are there not missing somthing ?

0 Likes
Message 4 of 10

in VBA?

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

0 Likes
Message 5 of 10

ilogic
0 Likes
Message 6 of 10

chandra.shekar.g
Autodesk Support
Autodesk Support

@Darkforce_the_ilogic_guy,

 

There is a in built event trigger is available in Inventor 2020.

 

iProperty_Change.png

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 7 of 10

There is already a build in trigger for iproperties , but is there a way to limit the change I need only to happen when I change iproperties.Custom.Surface ?
0 Likes
Message 8 of 10

the best I can do so far is to use the the Event Trigger IproPerties change

propertiechance.PNG

 

then Writte this code

 

Dim doc = ThisDoc.Document
	Dim sDocumentSubType As String = doc.SubType
	
'Undersøger Document type"
	
	If sDocumentSubType = "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}" Or sDocumentSubType = "{4D29B490-49B2-11D0-93C3-7E0706000000}"  Or sDocumentSubType = "{E60F81E1-49B3-11D0-93C3-7E0706000000}" Or sDocumentSubType = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}" Then ' = "assembly"Then	' = "Sheet Metal"
		
		
If iProperties.Value("Custom", "Surface") ="Colour 1" Or iProperties.Value("Custom", "Surface") ="Colour 2" Or iProperties.Value("Custom", "Surface") ="RAL 1028"Or iProperties.Value("Custom", "Surface") ="RAL 5003" Or iProperties.Value("Custom", "Surface") ="RAL 7035"Or iProperties.Value("Custom", "Surface") ="RAL 7037"Or iProperties.Value("Custom", "Surface") ="RAL 9005"Or iProperties.Value("Custom", "Surface") ="RAL 9010" Or iProperties.Value("Custom", "Surface") ="EG-Galv" Or iProperties.Value("Custom", "Surface") ="HDG-Galv"
 
iLogicVb.RunExternalRule("RefreshColour") 

End If		
	

End If
	



but it still  run the code if I do any change to iproperties , but I only want it to run when there has been a chance to iProperties.Value("Custom", "Surface")

 

I am using inventor 2018 ... can I use iproperties on All Document in inventor 2020 ?... I can only do it local on the fil in 2018 :S

 

0 Likes
Message 9 of 10

MjDeck
Autodesk
Autodesk

The iLogic iProperty Change event is not available on All Documents in Inventor 2020. It is still only in This Document. However, we can make it available on All Documents in a future version.

It looks like there is no way to find out which property has changed using the API.


Mike Deck
Software Developer
Autodesk, Inc.

0 Likes
Message 10 of 10

chandra.shekar.g
Autodesk Support
Autodesk Support

@Darkforce_the_ilogic_guy,

 

Can you please log a wish list on this at idea station using below link.

 

https://forums.autodesk.com/t5/inventor-ideas/idb-p/v1232

 

Thanks and regards


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes