Text Size Issue During Grip Editing of Custom Annotative Dimension Object

Text Size Issue During Grip Editing of Custom Annotative Dimension Object

465340553
Mentor Mentor
64 Views
1 Reply
Message 1 of 2

Text Size Issue During Grip Editing of Custom Annotative Dimension Object

465340553
Mentor
Mentor
Hello everyone,
I'm developing a custom annotative dimension object in ObjectARX 2018 that inherits from AcDbOrdinateDimension. The object displays X and Y coordinates and supports annotative scaling. However, I'm encountering a text size inconsistency issue during grip editing operations.
Problem Description:
When dragging grip points to edit the custom dimension object, the text size changes incorrectly. I can see two different text displays:
  1. Large text display (top-right): Shows coordinates with proper size
  1. Small text display (bottom-center😞 Shows the same coordinates but with much smaller text size
This happens specifically during grip editing operations, and the text size inconsistency is most noticeable when the annotation scale is set to 1:2.
Current Implementation:
 
// Text size calculation in UpdateTextSizeForAnnotation()
if (IsAnnotative())
{
    // Text size = base size / annotation scale (inverse relationship)
    double finalTextSize = dimStyle->dimtxt() / annotationScale;
    mStyle.setTextSize(finalTextSize);
}

// Text drawing in subWorldDraw()
mode->geometry().text(leaderEndPoint() + AcGeVector3d(deltaX, -1.2*h, 0),
    AcGeVector3d::kZAxis, AcGeVector3d::kXAxis, pMsgX, lenX, true, mStyle);
 
Key Methods Implemented:
  • GetCurrentAnnotationScale(): Gets annotation scale from database
  • IsAnnotative(): Checks if object is annotative using AcDbAnnotativeObjectPE
  • UpdateTextSizeForAnnotation(): Updates text size based on annotation scale
  • TxtParameterCalculate(): Calculates text parameters and positions
Questions:
  1. Grip Editing Text Size: How should text size be handled during grip editing operations? Should I override specific grip editing methods?
  1. Annotation Scale Application: Is the inverse relationship (text size = base size / annotation scale) correct for annotative objects?
  1. Dynamic Text Display: The small text display during grip editing seems to be generated by AutoCAD's built-in system. How can I ensure consistency with my custom text rendering?
  1. Method Override: Should I override methods like subMoveGripPointsAt() or subGetGripPoints() to handle text size during grip operations?
Environment:
  • ObjectARX 2018
  • Visual Studio 2022
  • AutoCAD 2018
Expected Behavior:
The text size should remain consistent during grip editing operations, matching the size of other annotative dimension objects in the drawing.
Any guidance or code examples would be greatly appreciated. Thank you for your help!
 
465340553_0-1757582195301.png

 

 
 

王磊
æ‚šèź€äžșæ­€ćž–ć­æ˜ŻćŠæœ‰ç”šïŒŸæŹąèżŽäžșæ­€ćž–ç‚čè”žă€‚
æ‚šçš„é—źéą˜æ˜ŻćŠć·ČćŸ—ćˆ°è§Łç­”ïŒŸèŻ·ç‚čć‡»â€œæŽ„ć—è§Łç­”â€æŒ‰é’źă€‚

EESignature

0 Likes
Accepted solutions (1)
65 Views
1 Reply
Reply (1)
Message 2 of 2

465340553
Mentor
Mentor
Accepted solution
Problem Solved! Thank you for your help.
After extensive debugging, I discovered the root cause of the issue: During grip editing operations, the database() method returns null, preventing proper annotation scale retrieval.
Note: This issue was caused by an oversight in the AI assistant's code implementation. Thank you for your patience and guidance in resolving this!

王磊
æ‚šèź€äžșæ­€ćž–ć­æ˜ŻćŠæœ‰ç”šïŒŸæŹąèżŽäžșæ­€ćž–ç‚čè”žă€‚
æ‚šçš„é—źéą˜æ˜ŻćŠć·ČćŸ—ćˆ°è§Łç­”ïŒŸèŻ·ç‚čć‡»â€œæŽ„ć—è§Łç­”â€æŒ‰é’źă€‚

EESignature

0 Likes