- From: alan.garny at dpag.ox.ac.uk (Alan Garny)
- Subject: [cellml-dev] Create a units definition within a component
- Date: Fri, 25 Sep 2009 11:50:57 +0100
>
-----Original Message-----
>
From: cellml-tools-developers-bounces at cellml.org [mailto:cellml-tools-
>
developers-bounces at cellml.org] On Behalf Of David Nickerson
>
>
> Would anyone know how to create a units definition within a component? I
>
can see how to do that within a model (using the CreateUnits method), but
I
>
couldn't find a similar of doing it for a component, yet both the Model
and
>
CellMLComponent classes offer access to the units local to the model and
>
CellML component, respectively. So, yes, I am a bit puzzled.
>
>
>
>
working from memory here, but I think you use the factory method on
>
the model and then use the addElement (or something similar -
>
addChild?) to add it to the CellMLComponent object. Creating objects
>
using the model just set the document scope (in the DOM sense) not the
>
actual location in the model. I think all objects are like that - you
>
need to add them to the appropriate parent after creating them.
>
>
Hope that helps guide you in the right direction :)
Good memory: it worked. :) (AddElement)
Alan
Archive powered by MHonArc 2.6.18.