How to change AcDbDimension Text Color ?

How to change AcDbDimension Text Color ?

Anonymous
Not applicable
805 Views
1 Reply
Message 1 of 2

How to change AcDbDimension Text Color ?

Anonymous
Not applicable

AcDbObjectId mSelectId;

use entsel  catch a Dimension,  get Dimension' Id.

now I  want change  its  TEXT  color?    How do ?

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

moogalm
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous wrote:

AcDbObjectId mSelectId;

use entsel  catch a Dimension,  get Dimension' Id.

now I  want change  its  TEXT  color?    How do ?


 

Or you looking for API in lisp or ObjectARX.

You say AcDbObjectId, and goes for entsel which is Lisp.

 

Anyway -

Lisp

(vlax-put-property (vlax-ename->vla-object (car (entsel))) 'TEXTCOLOR 3)

ARX:

AcDbObjectPointer<AcDbDimension> pDimension(mSelectId, AcDb::kForWrite);
	if (eOkVerify(pDimension.openStatus())) return;

	AcCmColor col = pDimension->dimclrt();
	col.setColorIndex(static_cast<Adesk::UInt16>(3));
	if (eOkVerify(pDimension->setDimclrt(col))) return;