ATTENTION

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.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 09-04-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default 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  
Old 09-04-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default 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  
Old 09-05-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

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  
Old 09-05-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

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."
  #5  
Old 09-06-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

I put an the person into the flowitem,but it can not show ,i do not know why,detail see attach .thank you
Attached Files
File Type: zip cannotshow.zip (41.8 KB, 191 views)
  #6  
Old 09-06-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

and i find a example ,add draw trigger ,but i still do not know how to do it,I really want to know how to do,and i do it but do not success, can you give more help? thank you
Attached Files
File Type: zip ItemVessel.zip (109.5 KB, 193 views)
File Type: zip flowitem.zip (38.1 KB, 198 views)
  #7  
Old 09-07-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

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.
Attached Files
File Type: zip cannotshow_TD.zip (34.9 KB, 212 views)
__________________
tom the (A)tom: "We have solved our problems ... now we have to fight the solutions."
  #8  
Old 09-07-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

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
  #9  
Old 09-07-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

tom ,These days,l learn some Flexsim basics and concepts very hard,if you tell me i will understand quickly thank you
  #10  
Old 09-08-2009
Tom David's Avatar
Tom David Tom David is offline
Flexsim User
 
Join Date: Aug 2007
Location: Schwaebisch Gmuend, Germany
Posts: 430
Downloads: 157
Uploads: 47
Thanks: 486
Thanked 450 Times in 233 Posts
Rep Power: 520
Tom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant futureTom David has a brilliant future
Default

Linwei,

I will not explain

Quote:
Linweixu: "how to do the OwnCustomDraw trigger stuff on a flow item"
Because the above solution with object in a flowitem is working. And what is the point to use a more difficult solution if there is an easy solution?

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  
Old 09-10-2009
LINWEIXU
Guest
 
Posts: n/a
Downloads:
Uploads:
Default

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


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.