cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MetaPicture condition through macro

mbergamini
MEGA
MEGA

Hallo everybody.

I was trying to create a condition through a macro to use a MetaPicture.

When I've created the macro in the MetaPicture Properties, it was not initialized.

I've searched for exsisting MetaPictures filtered through a macro, but I couldn't find any.

 

Can anybody give me an example of VB script for this kind of macros?

4 Replies

Got it ...

Sorry I have to dig out this post but it's not so clear for me.

 

The condition on my MetaPicture should check if it's object has a certain number of associated objects. The number depends on an Attribute that is set on the Object.

 

Example: 

I have an IT-City Planning Area on which I set an Attribute "max number of hosted elements" to a certain number.

The shape of my City Planning Area should then change wether the it hosts more or less elements.

 

I created a Macro on my MetaPicture Condition. But I'm not sure how I access the City Planning Area to read the Attribut  "max number of hosted elements" and get the Collection of hosted elements.

 

Does Ctx (in your example) refer to the Object the MetaPicture belongs to (in my example the City Planning Area) or does it refer to the MetaPicture?

 

Thanks in advance,

 

SJY

It works greatly!

 

Thank you

jhorber
MEGA
MEGA

Hello Martino

 

If such condition is tested by a macro, you need to implement a method MetaViewCheck
If the condition is fulfilled, the method should return true.

 

Example (VB script)

'MegaContext(Fields,Types)
Option Explicit
Function MetaViewCheck(oObject As MegaObject,Ctx As Object) As Boolean
  MetaViewCheck = False ‘ or True
End Function

 

Verify that in the line calling the macro

  • Operator is '= '
  • Value is '1' (not '0')
Jerome