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 05-05-2011
Nischith Kashyap's Avatar
Nischith Kashyap Nischith Kashyap is offline
Flexsim User
 
Join Date: Nov 2010
Location: Wollongong, Australia
Posts: 51
Downloads: 26
Uploads: 0
Thanks: 19
Thanked 0 Times in 0 Posts
Rep Power: 118
Nischith Kashyap is on a distinguished road
Default Object as a subnode to another object..

Hello

I have created a transporter in my tree structure and set its name and location via code which is working and the code i have used is as below.

treenode nnobj = node("/Transporter1", model());
treenode tnode;
tnode = createcopy(nnobj, model());
setname(tnode,gettablestr("Table1",x,1));
setloc(tnode,gettablenum("Table1",x,3),gettablenum ("Table1",x,4),0);

What i am trying to do is to generate a train as the rail API is not suiting my code. I am trying to create sub nodes for transporter 1 so that i am able to create transporter 2 which would be inserted in transporter 1 (not after) and move in the same way how transporter 1 moves, but with a small delay so as to get the snake kind of movement.

I tried the node insertinto, and the insert copy, but i am not getting a transporter (object) as a subnode to another transporter (object). I have attached the code i tried to use, but it doesnt work.

treenode nnobj = node("/Transporter2", model());
treenode tnode;
//tnode = createcopy(nnobj, model());
//tnode = createcopy(nnobj, nodeinsertinto(next(node("/Transporter1",model()))));
tnode = insertcopy(nnobj, node("/Transporter1", model()));
setname(tnode,gettablestr("Table1",x,1));
setloc(tnode,gettablenum("Table1",x,3),gettablenum ("Table1",x,4),0);

Basically, transporter 1 is the engine for my train, and transporter 2 is the number of carriages which would be subnodes to transporter 1, so that when i delete transporter 1, the carriages also get deleted.

Please help.....
  #2  
Old 05-06-2011
Jörg Vogel's Avatar
Jörg Vogel Jörg Vogel is offline
Flexsim User
 
Join Date: Sep 2007
Location: Hannover, Germany
Posts: 643
Downloads: 35
Uploads: 0
Thanks: 802
Thanked 665 Times in 410 Posts
Rep Power: 642
Jörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond reputeJörg Vogel has a reputation beyond repute
Default

Hi,
something like that
Click image for larger version
Name:	Obj_in_Obj.jpg
Views:	105
Size:	40.1 KB
ID:	1374
[edit]
sorry, it doesn't work as expected. My Fault.
[/edit]
Jörg


Thread Thread Starter Forum Replies Last Post
Solidworks object Simon Farsah Q&A 13 06-11-2012 08:36 PM
Can't see object in CT2.0 David Chan Container Terminal (CT) Library 1 04-21-2010 11:38 PM
send a flowitem from a mobile object to another mobile object KelvinHo Q&A 5 03-03-2010 08:24 AM
Get object class juan alberto Q&A 1 09-24-2009 06:25 AM
Transfer a mobile object by another mobile object KelvinHo Q&A 7 07-17-2008 09:32 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.