change-visual-sample-model.fsm
If we use either process flow or custom code to change the visual of certain objects, the visual look for the objects would not refresh during the model running. This problem also exists for rack, task executer, etc.
change-visual-sample-model.fsm
If we use either process flow or custom code to change the visual of certain objects, the visual look for the objects would not refresh during the model running. This problem also exists for rack, task executer, etc.
In this model, you are changing the size of an object whose shape is defined by subcomponents in the Animator.
You can use the following code line to have an object to resize its subcomponents based on its size:
applicationcommand("resizesubcomponents", object);
If you put that code after setting the size, this model will behave as you expected.
(See also How to scale the drawsurrogate objects?)
The Rack draws itself using custom draw code based on its SizeTable tab that defines the number and width of bays and the number and height of levels. It doesn't draw itself based on its size. You can return 1 in its Custom Draw trigger if you don't want it to do its default draw code.
Hey Phil! @phil.boboThanks for your answer. That works for me and here below is my code. I change every subcomponent's spatial and spatial size one by one and visual look behave as I want. Because I actually only want the yellow box for the truck object to resize not the actual components.
Is there a better way to do this?
And for rack, if we change the SizeTable tab during the model, how can we call the drawing process? Can you explain more on "You can return 1 in its Custom Draw trigger if you don't want it to do its default draw code."?
Object truck = token.truck; Object SemiCab = drawsurrogate(truck).subnodes["SemiCab"]; Object FrontWheels = SemiCab.subnodes[1]; Object RearWheels1 = SemiCab.subnodes[2]; Object RearWheels2 = SemiCab.subnodes[3]; setsize(truck, 268,84,105); applicationcommand("resizesubcomponents", truck); spatialx(SemiCab).value = 0; spatialz(SemiCab).value = 7; spatialsx(SemiCab).value = 248; spatialsy(SemiCab).value = 84; spatialsz(SemiCab).value = 105; spatialsx(FrontWheels).value = 29.05; spatialsy(FrontWheels).value = 76; spatialsz(FrontWheels).value = 28; spatialx(FrontWheels).value = 193.66; spatialy(FrontWheels).value = -4; spatialz(FrontWheels).value = -7; spatialsx(RearWheels1).value = 29.05; spatialsy(RearWheels1).value = 76; spatialsz(RearWheels1).value = 28; spatialx(RearWheels1).value = 44.61; spatialy(RearWheels1).value = -6; spatialz(RearWheels1).value = -7; spatialsx(RearWheels2).value = 29.05; spatialsy(RearWheels2).value = 76; spatialsz(RearWheels2).value = 28; spatialx(RearWheels2).value = 5.19; spatialy(RearWheels2).value = -6; spatialz(RearWheels2).value = -7;
You can call setSize() and setLocation() directly on those objects. You don't need to set the value of the attributes one by one:
SemiCab.setLocation(0, SemiCab.location.y, 7); SemiCab.setSize(248, 84, 105);
"And for rack, if we change the SizeTable tab during the model, how can we call the drawing process? Can you explain more on "You can return 1 in its Custom Draw trigger if you don't want it to do its default draw code."?"
You don't change the values in the SizeTable tab during the model. I was explaining that the Rack's draw is based on the variables on the Rack that are modified using the SizeTable tab, not based on its size. You shouldn't dynamically change the Rack's SizeTable during the model run.
The objects that are drawn via OpenGL code rather than an imported shape can have their draw disabled by returning 1 in the Custom Draw trigger:
I thought we are deprecating setsize and setloc... Nevermind I will use this.
The rack question is actually for another project. I imported a rack info excel file into flexsim using tables and autopopulated a lot of rack object based on that. In order to do that, I have to create the rack object first and update the sizetable tab based on the rack info table. That's why I need to redraw the rack during the model. Is there any workaround for this?
7 People are following this question.
FlexSim can help you understand and improve any system or process. Transform your existing data into accurate predictions.
FlexSim is a fully 3D simulation software environment. FlexSim can be used to simulate any process in any industry.
FlexSim®, FlexSim Healthcare™, Problem Solved.®, the FlexSim logo, the FlexSim X-mark, and the FlexSim Healthcare logo with stylized Caduceus mark are trademarks of FlexSim Software Products, Inc. All rights reserved.
Privacy | Do not sell or share my personal information | Cookie preferences | Report noncompliance | Terms of use | Legal | © Autodesk Inc. All rights reserved