ATTENTIONThis 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. |
flexsim.com |
#1
|
|||
|
|||
how to add custom draw code trigger in flow item
how to add custom draw code trigger in flow item
and if i use custom draw code trigger to Draw 3D Object, how can i chang the position of the 3D Object. { //************* PickOption Start *************\\ int objindex = /**/1/**/; int texindex = /**/1/**/; drawtomodelscale(current); drawobject(view,objindex,texindex); } |
#2
|
||||
|
||||
Custom Draw Code on flowitem
Linwei,
This is not really easy to do, but it is possible and if understood how to do it, it becomes easy. But I wonder again what you are trying to do, because to do stuff in the CustomDrawCode on a flowitem should only be done if known how to do it. In general doing stuff in the CustomDrawCode can slow down models and give strange behavior. Anyway, once I wanted to have a label shown on a flowitem and I solved it with the help of the tech support. That's why I uploaded a model, that everyone can have a look how this can be done. The model Sample_FloorStorageGUI_TD (/downloadPages/file&id=15) in the Download Section which I uploaded a long time ago and where the OnCustomDrawCode of a flowitem is manipulated. In the description of the model is described where the code can be found. It needs some tree manipulation and advanced knowledge of Flexsim to do this, because a node is added on the flowitem in the eventfunctions which is toggled Flexscript. This node calls an own nodefunction which also needs to be toggled Flexscript. Also two nodes need to be deleted. Have a look in the description and model and hopefully you will understand how it is done. To be honest, I will not explain it in every detail, because this is really advanced stuff and I am busy with a project with a strict dead line. Sometimes I wonder if you just ask these questions because you just like to know it or you really have an assignment to do to solve it. It would be really great if you would first describe what and why you are trying to do things and what is the idea behind it. Always keep in mind, that it is time and effort for the community to answer questions. Why would you change the position of a 3D Object in the CustomDrawCode?
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#3
|
|||
|
|||
I import a car (3ds file) in model, i use custom draw code trigger to Draw 3D person ,but the person not in seat ,I want to let him in seat ,so i want change his position, And some other similar needs. thank you for You in spite of being very busy toglance answering my question.
|
#4
|
||||
|
||||
Why don't you put an object (node - the person) into the flowitem and give it the right location? Just modify the car item in the flowitem bin. You do not need to use Custom Draw Code if you do it this way. If you want to switch on and off the visualization of the person there are several ways. One you be not to show the contents of the car another coud be to hide the 3D Shape of the person. That's at least the way I would do it.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#7
|
||||
|
||||
Linwei,
It really makes no fun to give you support if too many things must be explained. And you never explain what you already tried to solve it. Like said in my last mail, because I am busy with a project, I will not give you any support for some time and suggest you really should learn some more Flexsim basics and concepts, before you try to do advance stuff. I opened your model cannotshow. Why does the model need to compile? I did not understand what you were trying to do. I just put a rack in the model, copied the node of this rack in the tree into the BasicBox node in the FlowItem Bin and gave the rack a now location. Everything is working and this is not advanced stuff what I was doing here. It is working as I said in my last post and as I was expecting it to work. I attached my working model. Like said, I will not explain you how to do the OwnCustomDraw trigger stuff on a flow item, because this is really advance stuff, there is a model in the download section which shows how to do it and my above solution (object in flowitem) is working without using the advance stuff.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
#8
|
|||
|
|||
sorry,tom,i copied the node of this rack from library into the BasicBox node in the FlowItem Bin.
about " change the position of a 3D Object in the CustomDrawCode?" I find spacetranslate() which can do it? thank you I really want to know"how to do the OwnCustomDraw trigger stuff on a flow item". If you have free time to answer me .I think I will use in the future thank you very much |
#10
|
||||
|
||||
Linwei,
I will not explain Quote:
And because it is described in the model Sample_FloorStorageGUI_TD (/downloadPages/file&id=15) in the Download Section which I uploaded a long time ago and where the OnCustomDrawCode of a flowitem is manipulated. In the description of the model is described where the code can be found and what needs to be done. Figure out by yourself how it is done in the model if you like to use a more difficult solution. If you figure out how it is done, I am pretty sure that you can modify the code to your needs. Good success.
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions." |
The Following 2 Users Say Thank You to Tom David For This Useful Post: | ||
RalfGruber (09-08-2009) |
#11
|
|||
|
|||
in Sample_FloorStorageGUI_TD, i can not find node("/ToolPanel/ViewPanel/SelectView>items/Overview and node("/active/ortho",views())。
i am confused viewmenucommand("View|Designate This View (sv)",node("/active/ortho",views())); executefsnode(node("/ToolPanel/ViewPanel/SelectView>items/Overview",sv()),node("/ToolPanel/ViewPanel/SelectView>items/Overview",sv()),0,0,0); //REPAINT VIEW |
Thread | Thread Starter | Forum | Replies | Last Post |
Flow item in object in time 0 | KelvinHo | Q&A | 17 | 04-17-2012 09:12 AM |
one question about custom draw code trigger | LINWEIXU | Q&A | 5 | 08-03-2009 11:21 PM |
different capacity for different flow item for a same TE | KelvinHo | Q&A | 10 | 08-28-2008 08:12 AM |
Changing flow item by time | KelvinHo | Q&A | 6 | 08-13-2008 07:58 AM |
change 3D shape of a packed flow item | KelvinHo | Q&A | 2 | 02-27-2008 09:41 PM |