cancel
Showing results for 
Search instead for 
Did you mean: 

How to create extended object based on own metaclass using VBS

pandabrowski
Explorer
0 Kudos

Hi,

I'm trying to create my own class in physical model. I've created extension which includes an ExtendedLink Metaclass from common model ( "Exclude from Metamodel" on the ExtendedLink unmarked). Secondly, i've created Stereotype MyArrow (with "Use as metaclass" selected).

I'm trying to create a script that would create MyArrow object from VBS. I'm able to create an object manually, i can create it when it is not an MetaClass - but i don't know how should i call CreateObject to create own extended metaclass.

could you provide some examples or explenation?

thanks, rafal

Accepted Solutions (0)

Answers (2)

Answers (2)

pandabrowski
Explorer
0 Kudos

Hi guys,

i've finally found the way to create it - the answer seems logical when you know it :).

First i was trying to create it as it was some kind of the new metaclass so i tried to pass the public class name based on what i put in the extension to the create objec method.

The correct way is to create a regular object using the base class and then to change to the stereotype of the new metaclass.

dim obiekt
set obiekt = nothing
set obiekt = ActiveModel.createobject(cls_ExtendedObject)   'creation of the regular extended object, without subclassing
obiekt.name = "extended object own metaclass"
obiekt.stereotype = "OWN_EXTENDED_OBJECT"    'name of the stereotype which is also a metaclass

I hope that will help somebody 🙂

regards, rd

former_member200945
Contributor
0 Kudos

Please provide screenshot or model sample so we can better understand your question.