SetTextComponentOverride Broken

SetTextComponentOverride Broken

fugitt_christopher
Explorer Explorer
166 Views
4 Replies
Message 1 of 5

SetTextComponentOverride Broken

fugitt_christopher
Explorer
Explorer

In Civil 3D 2027 is the SetTextComponentOverride broken?

It replaces the text, but doesn't evaluate any of the non-modified properties. Opening the "Edit Label Text", pressing OK, then evaluates the Text Compenent as expected.

 

2026-04-08_13-13-50.png

 
if (hasTxtCompenentChange)
{
    label.UpgradeOpen();
    txtComponent.UpgradeOpen();
    label.SetTextComponentOverride(txtComponentObjId, txt);
    label.SetRegAppName("Yes", RegAppName);
    labelCount++;
}

 

0 Likes
167 Views
4 Replies
Replies (4)
Message 2 of 5

SoaresASBCAD
Collaborator
Collaborator

 

What you’re describing in Civil 3D 2027 / latest AutoCAD-based APIs is consistent with a known behavior change in label evaluation, not necessarily that SetTextComponentOverride() is “broken”.

SetTextComponentOverride():

  • Correctly replaces the stored text value of the text component
  • Does NOT force a full label re-evaluation
  • So any fields / expressions / property references inside the label can remain stale

When you open “Edit Label Text” and press OK, Civil 3D internally triggers:

  • a label regeneration / reevaluation cycle
  • which recalculates all dependent properties

That’s why everything suddenly updates.

In newer Civil 3D versions (2025–2027 range), Autodesk has been progressively:

  • decoupling text overrides from automatic recomputation
  • optimizing label refresh for performance (fewer forced regen cycles)

Result:
overrides no longer implicitly trigger full component re-evaluation

 

 

 

ASoares
0 Likes
Message 3 of 5

BlackBox_
Advisor
Advisor

@fugitt_christopher if adding a Regen() call and/or toggling IsVisible works, then Autodesk unwired the ObjectModified handler, to queue a downstream batch processing of a deferred dirty-list flush. 

 

If that's true, anyone previously watching ObjectModified for Label changes now has to jump to Overrules to watch Open() and/or Close().

 

Cheers


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D

0 Likes
Message 4 of 5

essam-salah
Advisor
Advisor

@SoaresASBCAD wrote:

...

That’s why everything suddenly updates.

In newer Civil 3D versions (2025–2027 range), Autodesk has been progressively:

  • decoupling text overrides from automatic recomputation
  • optimizing label refresh for performance (fewer forced regen cycles)

Result:
overrides no longer implicitly trigger full component re-evaluation


Hi, that's cool, but it should be a way to manuallay-programmetically trigger reevaluation/recomputation !!

0 Likes
Message 5 of 5

BlackBox_
Advisor
Advisor

If toggling Visible doesn't work... instead of Regen()... wonder if it's cheaper to duplicate the Label, then SwapIdWith(), and delete the original. 


"How we think determines what we do, and what we do determines what we get."

Sincpac C3D

0 Likes