question

Het avatar image
0 Likes"
Het asked Jason Lightfoot edited

Source 3D Visual Dimension get changes


I practiced transforming the 3D visuals of a source into a warehouse dock bay. After importing the .3ds fileDocking Bay N120608.3ds, I noticed that the source visual was too large. To fix this, I adjusted the height, width, and length to lower values.

1702994384905.png

In the image provided, you can see the original huge door and the small door after resizing. I attempted to save the adjusted visual in a library so that I could easily retrieve the same dimensions for different models. However, when I loaded the "Open Used Libraries" option to access my saved library, it displayed the original dimensions associated with the .3ds file. As a result, I had to repeatedly adjust the dimensions again.

1702994688071.png

Is there a better way to do it?

FlexSim 23.2.1
change visualsorce
1702994384905.png (228.2 KiB)
1702994688071.png (311.9 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Hi @Het, was Jason Lightfoot's answer helpful? If so, please click the "Accept" button at the bottom of their answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always comment back to reopen your question.

0 Likes 0 ·
Het avatar image Het Jason Lightfoot ♦♦ commented ·
Hello Jason,

Happy New Year. I tried that way. But it is not working on my model.

Is there a tutorial video or details step-by-step instructions for that?

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Het commented ·
What are the dimensions it should be?
0 Likes 0 ·
Show more comments

1 Answer

Jason Lightfoot avatar image
0 Likes"
Jason Lightfoot answered Jason Lightfoot edited

You can store a .xds file alongside the .3ds file to scale the object properly. Details here.

You can also save the reference to the shape and attributes as as Composite Visual Tree File from the "More Visuals" option - but this means you cannot then just browse to the shape file - you need to load the composite visual tree file yourself instead of browsing to the 3d file.

1704317998481.png


1704317998481.png (20.4 KiB)
· 4
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

Some code to create the spatial override file once you have it how you like :

Object current=Model.find("Shape1");  // change to your object or set as param(1) in a user command
string shapefilepath=shape(current).value;
int extPos= shapefilepath.lastIndexOf(".");
string overridePath=shapefilepath.substr(1,extPos-1)+".x"+shapefilepath.substr(extPos+2,2);
fileopen(overridePath,"w");
fpf(spatialsx(current).value);fpr();
fpf(spatialsy(current).value);fpr();
fpf(spatialsz(current).value);fpr();
fpf(offsetx(current).value);fpr();
fpf(offsety(current).value);fpr();
fpf(offsetz(current).value);fpr();
fpf(offsetsx(current).value);fpr();
fpf(offsetsy(current).value);fpr();
fpf(offsetsz(current).value);fpr();
fpf(offsetrx(current).value);fpr();
fpf(offsetry(current).value);fpr();
fpf(offsetrz(current).value);fpr();
fpd(centroid(current).value);
fileclose();


Update: Fixed the centroid - needs to be integer.

Attached is the .xds file for the original .3ds shape.

docking-bay-n120608.zip

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

In the meantime here's the resized shape (targetting a model with meters as the units)

docking-bay-n120608_jl.3ds

0 Likes 0 ·
Het avatar image Het Jason Lightfoot ♦♦ commented ·

Thanks for sharing .3ds file. It is working.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Het commented ·
I've updated the script - it should work now for any shape for which you want to change the default imported spatial values.
0 Likes 0 ·