Hi,
I m trying to clone an element, update some of its values and push it to its library:
if (domJoint *joint = daeSafeCast<domJoint>(inst_joint->getUrl().getElement()))
{
if (daeElement *new_joint = joint->clone())
{
// calc new id …
// …
new_joint->setAttribute("new_id", id.c_str()); // this crashes, new_joint is neither NULL nor an daeElement
// ...
// parent is the "library_joints" element
joint->getParent()->add(new_joint);
}
}
Can someone help me?