Message 1 of 4
Don't create joint
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to create a Joint using two JointOrigin, but I can't make it work. Everything seems to be fine just Ptr <Joint> joint = joints-> add (jointInput); will not return anything. Can you advise me where I make a mistake? I attach a part of the script that I am trying to create a Joint
Ptr occList = rootComp->allOccurrences(); if (!occList) return false; Ptr comp; for (size_t i = 0; i < occList->count(); ++i) { if (occList->item(i)->name() == "MainComponent:1") comp = occList->item(i)->component(); } Ptr occ = comp->occurrences()->item(1)->childOccurrences()->itemByName("Hinge cup Wood Screw:1"); if (!occ) return false; Ptr joinGeom1 = occ->component()->jointOrigins()->item(0); if (!joinGeom1) return false; Ptr joinGeom2 = comp->occurrences()->itemByName("SubCopmponent:1")->component()->jointOrigins()->item(0); if (!joinGeom2) return false; Ptr joints = comp->joints(); if (!joints) return false; Ptr jointInput = joints->createInput(joinGeom1, joinGeom2); if (!jointInput) return false; jointInput->setAsRigidJointMotion(); Ptr joint = joints->add(jointInput); if (!joint) return false;
And here is a screenshot of the document where I run the script