This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.
This model is a small example how to use the drawsurrogate functionality in combination with kinematics functionality in Flexsim.
Two objects are put into the Processor in the added drawsurrogate node. The FlexsimDBox will change the color during the process. The FlexsimDCylinder will move and rotate during the process.
The code can be found on the Processor in the triggers (OnReset, OnMessage, OnEntry, OnProcessFinish and OnCustomDrawCode).
One of the reasons for using drawsurrogate is that an object can have movable subcomponents, but the user interface with it as one object, i.e. when clicked on it is clicked on the main object, no matter where clicked. However, if a drawsurrogate subcomponent has an itemtype attribute, the engine interprets that as a flow item that should be interfaced separately, so it draws allowing the user to click on it separately. Once deleted the itemtype attribute, right-click on the subcomponent object and select Build / Rebind Object Attributes to apply it.
In the model items are used in the Processor, but the itemtype attribute was deleted, so the Processor gets selected if clicked on it.
Attention:
Do not delete or rename the object Logo_FlexsimD, because otherwise the model will not work correctly. Also do not rename, delete or rerank other objects.