- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi @BrianEkins @boopathi.sivakumar @chris.monachanZWSCF
We are trying to update the size of custom graphics text by slider input value. We have made UI for that. The size gets updated as we move the slider but it returns to its original size after leaving the slider. If we do not use the UI then size gets updated with the hard code given value .
Please refer to below GIF for more details.
We have used below code to update custom graphics text.
Model Scale code:
Ptr<BoundingBox3D> bbox = cgEnt->boundingBox();
Ptr<Point3D> maxPt = bbox->maxPoint();
Ptr<Point3D> minPt = bbox->minPoint();
_scaleFactor = 100 / minPt->distanceTo(maxPt);
Ptr<CustomGraphicsText> graphicsText = cgEnt->cast<CustomGraphicsText>();
bool result = graphicsText->size(_scaleFactor);
As per below code, it is possible to view scale custom graphic entity by slider input value.
View Scale code:
Ptr<BoundingBox3D> bbox = cgEnt->boundingBox();
Ptr<Point3D> maxPt = bbox->maxPoint();
Ptr<Point3D> minPt = bbox->minPoint();
_scaleFactor = 100 / minPt->distanceTo(maxPt);
Ptr<CustomGraphicsViewScale> attr = CustomGraphicsViewScale::create(_scaleFactor * _pixelScale->valueOne(), _anchorPt);
cgEnt->viewScale(attr);
Is there any solution for this?
Thanks in advance
Please refer video attachments for more details.
Solved! Go to Solution.