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
|
|||
|
|||
Standard Rack (Edit Open_GL)
Hi Everybody,
This is my first post in this community. I want to change the standard Flexsim rack object to a Pallet rack. (without shelf & with my own frame ) For this i made changes (Open GL) in the OnDraw cppfunctions of standard Rack library.(attached screenshot of my own rack). But i unfortunately don't know how to store the same as a library. I would appreciate any help and hint. Thanks in advance Ameen Shabeer Last edited by ameen shabeer; 06-30-2012 at 10:13 PM. |
#2
|
||||
|
||||
create a new userlibrary, right click your changed object, select: Edit -> add to userlibrary and save your userlibrary!!
|
#3
|
|||
|
|||
Dear Steven Hamoen,
Thanks for your reply, i tried this option, but it is not working . When i load the user library, it will display the rack icon. When i drag & drop a rack in the model , it will show the standard rack object (with shelf). The modification which i made is in the following path. Library/Rack/Behaviour/cppfunctions/OnDraw Thanks & Regard Ameen |
#4
|
|||
|
|||
Put your OpenGL code into the onDraw trigger of the object instance in the model and return 1. Then right click the model instance and follow Steven's instructions.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
Phil BoBo (07-02-2012) |
#5
|
|||
|
|||
Dear Jason Lightfoot,
Thanks for your reply, if i use your option, i have to re assign all the rack parameters in program and need to call lot of variables from the tree . but the OnDraw in the cppfunctions is very easy to edit. Thanks & Regard Ameen |
#6
|
|||
|
|||
Could you set the opacity of the model instance to zero and then just add the code to draw your own vertical supports in the draw code of that instance (this time return 0) ?
|
#7
|
|||
|
|||
Dear Jason,
On using "ondraw" trigger its working fine. But for taking further to create the user library with our own variable is difficult (The picture i attached in previous post is only 20% of my activity). It would be fine if you can help to compile and create a rack user library which is already modified in the Library/Rack/Behaviour/cppfunctions/OnDraw |
#8
|
|||
|
|||
Try this as a start - it's not complete. Apply basic settings is okay but something odd is happening with the RackParameters Apply.
|
The Following User Says Thank You to Jason Lightfoot For This Useful Post: | ||
ameen shabeer (07-02-2012) |
#9
|
|||
|
|||
Dear Jason,
As you said, the 'Apply basic settings' working fine but the RackParameters Apply is not functioning. when i try this, in large models getting hanged for some time . i know the entire codding you changed from openGLto flexscript so the compiling is not required. is it possible to compile the same to speed up the model? when i made necessary changes in the rack cppfunctions/OnDraw to get my own frame in rack model, it is working fine after compiling the same, but why cant i convert the same in to a library ? Regards Ameen Last edited by ameen shabeer; 07-02-2012 at 11:52 AM. |
#10
|
|||
|
|||
Yes you can make the onDraw trigger C++ or link it to a DLL.
Have you considered importing 3D shapes for the rack instead of drawing it? |
#12
|
||||
|
||||
Quote:
Quote:
Jason's suggestion to put the code in the Rack's draw trigger is how you can make this code easily reusable in a User Library. If you want to speed up the code, you can put it in a dll that is called from the OnDraw trigger. This will make your library portable and fast without requiring the user to compile it each time. |
The Following 2 Users Say Thank You to Phil BoBo For This Useful Post: | ||
Jason Lightfoot (07-03-2012) |
#13
|
|||
|
|||
Dear Phil BoBo,
thanks for your valuable time and consideration!!! I understood, but when i compile the Jason's code, it is showing error, is that is because of following code ? is this code compilable ? int v_floorstorage=getvarnum(current,"floorstorage"); double b_spatialsx=get(spatialsx(current)); double b_spatialsy=get(spatialsy(current)); double b_spatialsz=get(spatialsz(current)); double b_imageindexobject=get(imageindexobject(current)); double v_rackdrawmode=getvarnum(current,"rackdrawmode"); double v_opacity=getvarnum(current,"opacity"); double v_markreadytogo=getvarnum(current,"markreadytogo"); double v_tiltvalue=getvarnum(current,"tiltvalue"); double opacity = v_opacity; |
#14
|
||||
|
||||
v_ and b_ are special characters at the beginning of variable names when compiling Flexsim C++ code. Change the variable names to something else, such as _v_floorstorage or _b_spatialsx.
Jason was converting C++ Flexscript library code into Flexscript for you. The conversion mechanism he used doesn't work with both Flexscript and C++. You just need to adjust the variable names so that they don't match the special usage in the library. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
ameen shabeer (07-03-2012) |
Tags |
open gl, rack |
Thread | Thread Starter | Forum | Replies | Last Post |
Where can I see the source code for a Standard Object Library? | shafizad | Q&A | 1 | 03-14-2012 01:20 PM |
Standard Folder for models | Nico Zahn | Q&A | 0 | 10-02-2009 03:13 AM |
Time-Varrying Source Doesn't Like Small Standard Deviation | david_white | Q&A | 10 | 06-26-2008 01:31 PM |
Standard Operator speed/ acceleration/ decelleration | Paul Dowling | Q&A | 0 | 06-18-2008 09:24 PM |
Queue (standard, LIFO, FIFO) | Tom David | Q&A | 2 | 05-15-2008 10:30 AM |