Author Topic: Can I use Hidden Menus for this?  (Read 735 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6213
  • Karma: +97/-88
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Can I use Hidden Menus for this?
« on: March 14, 2018, 02:16:26 pm »
As I've mentioned, we "hand roll" our MDG.  Don't ask...  However, before I go down a spurious track (and waste a PILE of effort), I'd like to confirm that I can theoretically do the following...

We have a number of components that are very similar.  At present, each has it's own metatype (to make it easy for the modeller to select the one they want to drag off the toolbox).  But, in fact, they are pretty much the same metatype but with a specific property set to an enumerated value.  The property can be a tagged value.  What I'd like to be able to do is have one metatype on the toolbox and as the modeller drags it off the toolbox, it asks which "subtype" it is (using the hidden menu) and sets the tagged value appropriately.  I realise I can do it with scripts and events, but I'm after a declarative solution if possible.  Our shape script (for the metatype) can then respond to the tagged value.

TIA,
Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Nizam

  • EA User
  • **
  • Posts: 301
  • Karma: +9/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Can I use Hidden Menus for this?
« Reply #1 on: March 14, 2018, 02:33:04 pm »
Hi Paolo
May be i'm saying something that you already know.

We can do that in the MDG definition. You need to add '_subtypeproperty' and set the tagged value (based on which you want your dropdown to work) as its initial value

which should look something like this in your MDG
Code: [Select]
<AppliesTo>
<Apply type="Component">
<Property name="_subtypeProperty" value="IC::ICType"/>
<Property name="isIndirectlyInstantiated" value="true"/>
</Apply>
</AppliesTo>
<TaggedValues>
<Tag name="ICType" type="" description="" unit="" values="" default=""/>
</TaggedValues>

HTH
Nizam

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 6213
  • Karma: +97/-88
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Can I use Hidden Menus for this?
« Reply #2 on: March 14, 2018, 02:53:50 pm »
Thanks, Nizam,

Just the shot!

As we say here in OZ:  "just like a bought one!"

Thanks again,
Paolo

[EDIT: my experimentation suggests you can only set ONE _subtypeProperty (seems logical); but is that actually so?]
« Last Edit: March 14, 2018, 03:03:31 pm by Paolo F Cantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Nizam

  • EA User
  • **
  • Posts: 301
  • Karma: +9/-2
  • Model Sharing - Simplified
    • View Profile
    • Professional Model Collaboration
Re: Can I use Hidden Menus for this?
« Reply #3 on: March 14, 2018, 04:43:14 pm »
Good to know Paolo
Yes it is only one _subtypeproperty, i've created multiple metaclass instances to extend different stereotypes with hidden menus (albeit extending the same metaclass).

Best Regards
Nizam