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 06-30-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Post 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
Attached Thumbnails
Click image for larger version
Name:	Rack_GL.JPG
Views:	117
Size:	68.1 KB
ID:	1834  

Last edited by ameen shabeer; 06-30-2012 at 10:13 PM.
  #2  
Old 07-02-2012
Steven Hamoen's Avatar
Steven Hamoen Steven Hamoen is offline
Talumis, Flexsim Distributor, The Netherlands
 
Join Date: Aug 2007
Location: Soest, NL
Posts: 854
Downloads: 43
Uploads: 0
Thanks: 391
Thanked 661 Times in 379 Posts
Rep Power: 684
Steven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond reputeSteven Hamoen has a reputation beyond repute
Default

create a new userlibrary, right click your changed object, select: Edit -> add to userlibrary and save your userlibrary!!
  #3  
Old 07-02-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Post

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  
Old 07-02-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 07-02-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Post

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  
Old 07-02-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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  
Old 07-02-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Default

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  
Old 07-02-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

Try this as a start - it's not complete. Apply basic settings is okay but something odd is happening with the RackParameters Apply.
Attached Files
File Type: fsm RackDrawTrigger.fsm (51.8 KB, 97 views)
The Following User Says Thank You to Jason Lightfoot For This Useful Post:
ameen shabeer (07-02-2012)
  #9  
Old 07-02-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Default

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  
Old 07-02-2012
Jason Lightfoot Jason Lightfoot is offline
Flexsim Consultant
 
Join Date: Aug 2007
Location: Somerset, UK
Posts: 719
Downloads: 20
Uploads: 0
Thanks: 123
Thanked 953 Times in 446 Posts
Rep Power: 773
Jason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond reputeJason Lightfoot has a reputation beyond repute
Default

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?
  #11  
Old 07-02-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Post

Dear Jason,

i have 10+ variety of racks , so the import option not ideal for me.
  #12  
Old 07-03-2012
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

Quote:
Originally Posted by Jason Lightfoot View Post
Try this as a start - it's not complete. Apply basic settings is okay but something odd is happening with the RackParameters Apply.
This is a bug with the MeasuredValueEdits on the General tab. The problem is that when you apply the Basic Settings, sometimes it isn't properly setting the SX, SY, and SZ values correctly on the General tab. This will be fixed in 6.0.2 (hopefully released by the end of this month).


Quote:
Originally Posted by ameen shabeer View Post
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 ?
If you are modifying the library itself, then your changes won't be saved when you close and open Flexsim. Also, you have to compile the entire session after making each change.

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  
Old 07-03-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Default

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  
Old 07-03-2012
Phil BoBo's Avatar
Phil BoBo Phil BoBo is offline
Flexsim Development
 
Join Date: Jan 2008
Posts: 756
Downloads: 109
Uploads: 18
Thanks: 385
Thanked 1,483 Times in 525 Posts
Rep Power: 1174
Phil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond reputePhil BoBo has a reputation beyond repute
Default

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)
  #15  
Old 07-03-2012
ameen shabeer ameen shabeer is offline
Contributing
 
Join Date: Jun 2012
Posts: 28
Downloads: 30
Uploads: 0
Thanks: 15
Thanked 1 Time in 1 Post
Rep Power: 0
ameen shabeer is on a distinguished road
Thumbs up

Excellent
it is working well .
Thanks Phil BoBo, Jason Lightfoot, Steven Hamoen for the reply.

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


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.