How to use TriadEvents?

How to use TriadEvents?

liminma8458
Collaborator Collaborator
541 Views
1 Reply
Message 1 of 2

How to use TriadEvents?

liminma8458
Collaborator
Collaborator

Hi, everyone,

TriadEvent has a very good dialog interface to move or rotate an item, as below picture 1. But I can't find a sample code on how to do it anywhere (in help file, there is one that only is able to move the triad itself). So if I have an assembly with a single block inside and want to enter in the dialog boxes x: 10, y: 10, z: 10 to move it, how should I setup the triadevents to do it? Another scenario is if I drag the triad to new location, how to make the block follow to that location?

(Attached is the assembly models and my preliminary code which only is able to move the triad itself.)

 

triad.PNG

 

liminma8458_0-1592492454644.png

 

 

Thanks
Limin
Inventor pro 2023 64 bit update 5.3; Windows 11 pro 64 bit version 24H2; Office 2013 64 bit

Download iCable in App Store to Create Cables Easily

0 Likes
Accepted solutions (1)
542 Views
1 Reply
Reply (1)
Message 2 of 2

YuhanZhang
Autodesk
Autodesk
Accepted solution

It depends how you would like to show the transformation of the occurrence in assembly, you can check the CoordinateSystem in OnStartMove, OnMove and OnEndMove to calculate the transformation of each move and then tranform the occurrence for each move. Silimar you can use the OnStartSequence and OnEndSequence to calculate the transformation of a series of move and tranform the occurrence once for these moves. 

 

A simple case is you place an occurrence to the origin of assembly and no rotation, and you place your triade to the same coordinate of your assembly, then in each OnMove event you can just set ComponentOccurrence.Transformation = CoordinateSystem to tranform(translate/rotate) the occurrence. For other cases you usually need to calculate your matrix for occurrence's transformation.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes