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 > Tips and Tricks
Downloads

Tips and Tricks Share helpful modeling ideas

  #1  
Old 03-18-2015
Clair A Clair A is offline
Simulation Engineer
 
Join Date: Dec 2011
Location: France
Posts: 26
Downloads: 11
Uploads: 0
Thanks: 68
Thanked 90 Times in 20 Posts
Rep Power: 162
Clair A is a jewel in the roughClair A is a jewel in the roughClair A is a jewel in the roughClair A is a jewel in the rough
Default Export media files

By default all 3D shapes, texture, images are embedded with the model file.

You don't have the original media files and want to extract them from the FlexSim model, maybe for reuse in another model ?

The data from packed media is stored in the tree in the node "packedmedia":



If you want to get the data from packed media back to a media file, you can use:

Code:
applicationcommand("byteblocktofile", node binarydata, string filepath);
As an example, execute the script in the attached sample model to export all 3D shapes and textures from the model.

Code:
treenode folder = first(packedmedia(model));
for(int i = 1; i <= content(folder); i++){
    treenode file = rank(folder, i);
    applicationcommand("byteblocktofile", file, concat(modeldir, getname(file)));
}
Attached Thumbnails
Click image for larger version
Name:	tree.PNG
Views:	965
Size:	6.3 KB
ID:	2797  
Attached Files
File Type: fsm PieFactoryV7_ExtractPackedMedia.fsm (1.08 MB, 626 views)
The Following 11 Users Say Thank You to Clair A For This Useful Post:
walid dirahoui (03-19-2015)

Tags
3d shapes, embed, export, media


Thread Thread Starter Forum Replies Last Post
Auto Loading of .skp into Media File Folder Howe Chiat Cheng User Development 4 07-19-2013 07:02 PM
Use flexsim3 3D media in flexsim4.32? qin tian Q&A 2 12-15-2008 02:23 PM
Flowitem Bin and Media Files Martijn van Oostenbrugge Q&A 10 09-04-2008 09:13 AM
My gripes and improvement suggestions for v4.30 (Ctrl+C/V in tables, media path updater) Tom David Gripes and Goodies 2 03-18-2008 08:29 PM


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.