question

George C2 avatar image
0 Likes"
George C2 asked George C2 commented

Code: How do I create a 3D Processor with Operator visuals?

My goal is to create a 3D Processor within FlexSim custom code with the 3D visuals of an operator.

My Current Code is as following:

  1. treenode newPerson;
  2. newPerson = createinstance(node("fixedresources/Processor", library()),model());
  3. setobjectshapeindex(newPerson,16);
  4. setobjecttextureindex(newPerson,5);

[The #16 and #5 come from "View" -> "Media Files" -> "Shapes" and "Images" index values];

The issues I am having are:

1. When the code is run, the operator processor looks massively large compared to an actual operator [See Figure 1]

2. After hitting the "Reset" button, the processor resets to what it originally looks like [See Figure 2]

*Note: Ideally, I would prefer not to create a custom library to solve this solution, but if you can provide code to access it from a saved filepath then I can accept that as a Plan B.

FlexSim 19.1.0
operatorprocessorcodevisual
figure-1.jpg (29.8 KiB)
figure-2.jpg (31.4 KiB)
5 |100000

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

1 Answer

Phil BoBo avatar image
0 Likes"
Phil BoBo answered George C2 commented

Rather than storing the object in a user library, you could just store it in a node in the Tools folder in your model tree. Then reference it there and call createcopy().

Just make the base object the way you want and copy/paste it into the tree.

processor-man.fsm

You can make a processor look like an operator by either:

1. (If you don't need animations) set its 3D shape to C:\Program Files\FlexSim 2019 Update 1\fs3d\Operator\OperatorMale_Standing\OperatorMaleStanding.fbx

2. (If you want its animations) on the General tab, by Visuals/Animations, press the Load button and select C:\Program Files\FlexSim 2019 Update 1\fs3d\Operator\OperatorMale_LowRes\OperatorMale.t


processor-man.png (190.3 KiB)
processor-man.fsm (24.8 KiB)
· 3
5 |100000

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