question

Lars Jacobsen avatar image
1 Like"
Lars Jacobsen asked Lars Jacobsen commented

No OnDraw trigger for most FlowItems - Why?

Why is there no OnDraw trigger available on most FlowItems? Is it by design or ?

FlexSim 20.2.1
flexsim 20.2.1flowitemsondraw
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
1 Like"
Phil BoBo answered Lars Jacobsen commented

Yes, this is by design. Having an OnDraw trigger on flowitems causes slow rendering performance.

By default, flowitems have DRAW_FLAG_NO_ON_DRAW toggled on their drawflags attribute to improve rendering performance.

· 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.

Lars Jacobsen avatar image Lars Jacobsen commented ·

OK...... @phil.bobo

0 Likes 0 ·
Allister Wilson avatar image Allister Wilson Lars Jacobsen commented ·

@lars_christian.j2 To expand a bit on Phil's answer, using that information you can add your own draw code to a flowitem if necessary.

In the attached (20.0) model, I

  • created a new flowitem: CustomDrawnBox
  • unset the DRAW_FLAG_NO_ON_DRAW flag
  • added an OnDraw attribute which includes a call to drawsphere

20200901_flowitem_custom_draw.fsm

2 Likes 2 ·
Lars Jacobsen avatar image Lars Jacobsen commented ·

Thanks @alistair.w

0 Likes 0 ·