Color issue with SetGraphics

36 views
Skip to first unread message

Lorenzo Ferro

unread,
May 8, 2026, 4:09:50 AMMay 8
to JaamSim Users Discussion Group
Dear Harry,

in a simulation I tried to use SetGraphics to change the shape and color of a simulation entity but it turned out that while the shape is correctly changed the color remains the one of the incoming entity. The new entities generated by SetGraphics have the correct Size and GraphicalLenght properties but the Prototype property remains the one of the incoming entity.

Please find an example herein attached.

I take this chance also to ask another question. In the attached example the second Conveyor has an accumulation length set the same as the GraphicalLength of the "Shape_green" entity. If I would have different entities of different graphical length entering the conveyor, would it be possible to set different accumulation lengths for every single entity processed?

Thank you.
Lorenzo
Color_Issue.cfg

Lorenzo Ferro

unread,
May 11, 2026, 12:35:37 PM (11 days ago) May 11
to JaamSim Users Discussion Group
Hello Harry,

About my second question, I 've figured out that there's a recent example showing the AlignEntities=TRUE option that allows for different entities lengths on a conveyor. That's great! Thank you. Sorry if I didn't check before.

What about the color issue?
I found out it happens also if you set a different display entity, for example, if SetGraphics receives an incoming Collada model and then it returns a Shape object, the color of the Shape object will always be Gray coloured even though it was set to a different one.

Thank you.
Lorenzo

Harry King

unread,
May 19, 2026, 12:29:19 AM (4 days ago) May 19
to JaamSim Users Discussion Group
Hi Lorenzo,

The SetGraphics object is only able to set the DisplayModel, Size, Alignment, and Orientation for the target object. It does not touch the other inputs for the entity.

If you want the colour to be transferred, you need to create a GreenRectangle ShapeModel that  that is used for the DisplayModel input for the Shape_green object. For this to work, the FillColour input for the prototype must be blank, otherwise it will override the value from the ShapeModel.

Or, you can set the FillColour input to the expression this.colour, where 'colour' is an attribute that can be set using an Assign object.

The SetGraphic object will need to be re-thought at some point. The more the graphics can be set programmatically with input expressions and attribute values, the less useful this object will become.

Harry

lorenz...@gmail.com

unread,
May 20, 2026, 10:28:48 AM (2 days ago) May 20
to Harry King, JaamSim Users Discussion Group
Sera Harry,

Thank you for providing a solution.
Programmatic solutions are always much welcome since they are flexible.

In my opinion the SetGraphics object remains a very confortable tool, an helper that with no coding (and just a drag and drop) makes things very easy and quick, in the spirit of JaamSim (I suppose).

Thank you for your always prompt support.
Lorenzo

Il giorno 19 mag 2026, alle ore 09:59, Harry King <d.harr...@gmail.com> ha scritto:

Hi Lorenzo,
--
You received this message because you are subscribed to the Google Groups "JaamSim Users Discussion Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jaamsim-user...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/jaamsim-users/e45671bb-df6e-4777-87e0-f8d34c1e8ec2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages