std::vector<Slvs_hConstraint>::iterator aCIter = mySlvsConstraints.begin();
for (; aCIter != mySlvsConstraints.end(); aCIter++) {
Slvs_Constraint aConstraint = myStorage->getConstraint(*aCIter);
- if (aValueAttr)
+ if (aValueAttr) {
aConstraint.valA = aValue;
+ if (aConstraint.type == SLVS_C_DIAMETER)
+ aConstraint.valA *= 2.0;
+ }
Slvs_hEntity* aCoeffs[6] = {
&aConstraint.ptA, &aConstraint.ptB,
&aConstraint.entityA, &aConstraint.entityB,
#include <SketchPlugin_Constraint.h>
+#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeRefAttr.h>
#include <string>
virtual void adjustConstraint()
{
+ AttributeDoublePtr aValueAttr = std::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
+ myBaseConstraint->attribute(SketchPlugin_Constraint::VALUE()));
Slvs_Constraint aConstraint = myStorage->getConstraint(mySlvsConstraints.front());
- aConstraint.valA *= 2.0;
+ aConstraint.valA = 2.0 * aValueAttr->value();
myStorage->updateConstraint(aConstraint);
}
};