- From: david.nickerson at gmail.com (David Nickerson)
- Subject: [cellml-dev] Create a units definition within a component
- Date: Fri, 25 Sep 2009 22:39:50 +1200
>
>
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 :)
Cheers,
Andre.
Archive powered by MHonArc 2.6.18.