Assembly: Fixes bug for origins in Sub-AssemblyLink (#22415)
This commit is contained in:
@@ -207,6 +207,7 @@ void AssemblyLink::synchronizeComponents()
|
||||
|
||||
auto* subAsmLink = freecad_cast<AssemblyLink*>(obj2);
|
||||
auto* link2 = dynamic_cast<App::Link*>(obj2);
|
||||
|
||||
if (subAsmLink) {
|
||||
linkedObj = subAsmLink->getLinkedObject2(false); // not recursive
|
||||
}
|
||||
@@ -214,7 +215,7 @@ void AssemblyLink::synchronizeComponents()
|
||||
linkedObj = link2->getLinkedObject(false); // not recursive
|
||||
}
|
||||
else {
|
||||
// We consider only Links and AssemblyLinks in the AssemblyLink.
|
||||
// We consider only Links and AssemblyLinks
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -228,8 +229,10 @@ void AssemblyLink::synchronizeComponents()
|
||||
// Add a link or a AssemblyLink to it in the AssemblyLink.
|
||||
if (obj->isDerivedFrom<AssemblyLink>()) {
|
||||
auto* asmLink = static_cast<AssemblyLink*>(obj);
|
||||
auto* subAsmLink = new AssemblyLink();
|
||||
doc->addObject(subAsmLink, obj->getNameInDocument());
|
||||
|
||||
App::DocumentObject* newObj =
|
||||
doc->addObject("Assembly::AssemblyLink", obj->getNameInDocument());
|
||||
auto* subAsmLink = static_cast<AssemblyLink*>(newObj);
|
||||
subAsmLink->LinkedObject.setValue(obj);
|
||||
subAsmLink->Rigid.setValue(asmLink->Rigid.getValue());
|
||||
subAsmLink->Label.setValue(obj->Label.getValue());
|
||||
|
||||
@@ -68,6 +68,9 @@ public:
|
||||
|
||||
bool isRigid();
|
||||
|
||||
/**
|
||||
* Update all of the components and joints from the Assembly
|
||||
*/
|
||||
void updateContents();
|
||||
|
||||
void synchronizeComponents();
|
||||
|
||||
Reference in New Issue
Block a user