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
|
|||
|
|||
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
|
|||
|
|||
'\' 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
|
||||
|
||||
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 |