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-09-2011
shashanktrivedi shashanktrivedi is offline
Flexsim User
 
Join Date: Apr 2011
Posts: 59
Downloads: 26
Uploads: 0
Thanks: 26
Thanked 16 Times in 3 Posts
Rep Power: 122
shashanktrivedi will become famous soon enough
Default Importing Object Shape through script

Hi,

We are trying to change Transporter shape through script as mentioned below:

str1 ="Truck\Truck.wrl" ;
setnodestr(node("/Truck1>visual/shape",model()),str1);

Above script is writing TruckTruck.wrl in 3d shape part not Truck\Truck.wrl.

I am not sure why it is happening and what is the remedy.

Kindly advise.

Regards
Shashank Trivedi
  #2  
Old 06-09-2011
Alex Christensen Alex Christensen is offline
Flexsim Technical Support
 
Join Date: Nov 2007
Location: Provo, UT
Posts: 96
Downloads: 41
Uploads: 8
Thanks: 29
Thanked 141 Times in 56 Posts
Rep Power: 298
Alex Christensen is a splendid one to beholdAlex Christensen is a splendid one to beholdAlex Christensen is a splendid one to beholdAlex Christensen is a splendid one to beholdAlex Christensen is a splendid one to beholdAlex Christensen is a splendid one to beholdAlex Christensen is a splendid one to behold
Default

'\' is an escape character used to put things like tabs, new lines, or quotes into a string. To put a backslash into a string in Flexscript, C, C++, or many other languages, you need two of them:
Code:
string str1 ="Truck\\Truck.wrl" ;
The Following 2 Users Say Thank You to Alex Christensen For This Useful Post:
shashanktrivedi (06-15-2011)
  #3  
Old 06-10-2011
RalfGruber's Avatar
RalfGruber RalfGruber is offline
FlexSim Software Products
 
Join Date: Jul 2007
Location: Orem, UT, USA
Posts: 195
Downloads: 37
Uploads: 0
Thanks: 518
Thanked 294 Times in 124 Posts
Rep Power: 345
RalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to beholdRalfGruber is a splendid one to behold
Default

Shashank,

another way is to use the frame attribute. If your original shape is "Truck.wrl", call the optional one "TruckFRAME1.wrl".
Then you can just use setframe(object,frame no) in this case

setframe(thetruck,1);

to change to the other frame. To return to the original frame just reset it to zero again.
You can use as many frame shapes as you want to, but you have to start with FRAME1 and all the following frame need to be consecutive numbers.

Best wishes

Ralf
aka Ralle
Flexsim
The Following User Says Thank You to RalfGruber For This Useful Post:
shashanktrivedi (06-15-2011)

Tags
dynamic, importingobject, script


Thread Thread Starter Forum Replies Last Post
String value changes to int value on importing ?? Nischith Kashyap Q&A 3 05-05-2011 08:46 AM
Excel File Importing John Kim Container Terminal (CT) Library 0 08-06-2009 03:21 PM
Importing OpenFlight models Kenny Macleod Q&A 2 08-27-2008 03:43 PM
Need A Script Gavin Douglas Q&A 3 07-18-2008 10:00 AM
dbimporttable: importing date Lolke Koopmans Q&A 7 02-22-2008 05:57 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.