How to set location by code in Proccess Flow Create Kinematics?

How to set location by code in Proccess Flow Create Kinematics?

Troy7
Not applicable
617 Views
3 Replies
Message 1 of 4

How to set location by code in Proccess Flow Create Kinematics?

Troy7
Not applicable

[ FlexSim 22.2.0 ]

I tried to set the x location by custom code in create kinematics:

1685088533159.png

here is my code:

1685088635464.png

It just simply return 1, but system console throw an error:

time: 0.000000 exception: FlexScript exception: Invalid down cast. Object is not an instance of the target type. at MODEL:/Tools/ProcessFlow/ProcessFlow/Create Kinematics>variables/xLoc

I don't know how to solve it.

What is the correct way to set the location by code?

0 Likes
Accepted solutions (1)
618 Views
3 Replies
Replies (3)
Message 2 of 4

philboboADSK
Autodesk
Autodesk
Accepted solution

This looks like a bug with the header of that field. The kinematics node is passed as param(4), which is a treenode, not an Object.

Change "Object" to "treenode" on line 5.

I'll add a case to the development list to fix this code header.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 3 of 4

Troy7
Not applicable
Thanks a lot, solved my problem.
0 Likes
Message 4 of 4

Matthew_Gillespie
Autodesk
Autodesk

@Troy

This issue is fixed in 23.0.9 and 23.1.3 released today.



Matthew Gillespie
FlexSim Software Developer

0 Likes