- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm working with aligned dimensions in AutoCAD using the AcDbAlignedDimension class. I've been trying to update dimLinePoint, xline1Point, and xline2Point, but I’ve noticed that changes to dimLinePoint are not reflecting in the drawing.
Has anyone else experienced this? Are there specific methods or requirements I should be aware of to ensure that changes to dimLinePoint take effect?
If you look at the image below the first dimension is before moving xline1Point and xline2Point, second is how i want it to be after moving points and third dimension is how it is after moving xline points.
Code below should be moving aligned dimension xline1, xline2 and dim points, but its not working correctly.
AcDbAlignedDimension* pDimension = AcDbAlignedDimension::cast(entClone);
// Retrieve the current start, end, and dimension line points
AcGePoint3d startPt = pDimension->xLine1Point();
AcGePoint3d endPt = pDimension->xLine2Point();
AcGePoint3d dimPt = pDimension->dimLinePoint();
AcGePoint3d textPt = pDimension->textPosition();
// Scale xLine1, xLine2, and dimLinePoint
startPt.x = refPoint.x + (startPt.x - refPoint.x) * xScaleFactor;
startPt.y = refPoint.y + (startPt.y - refPoint.y) * yScaleFactor;
endPt.x = refPoint.x + (endPt.x - refPoint.x) * xScaleFactor;
endPt.y = refPoint.y + (endPt.y - refPoint.y) * yScaleFactor;
dimPt.x = refPoint.x + (dimPt.x - refPoint.x) * xScaleFactor;
dimPt.y = refPoint.y + (dimPt.y - refPoint.y) * yScaleFactor;
textPt.x = refPoint.x + (textPt.x - refPoint.x) * xScaleFactor;
textPt.y = refPoint.y + (textPt.y - refPoint.y) * yScaleFactor;
// Update the dimension with the new points
pDimension->setXLine1Point(startPt);
pDimension->setXLine2Point(endPt);
pDimension->setDimLinePoint(dimPt);
pDimension->setTextPosition(textPt); Thanks for your help!
Solved! Go to Solution.