ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

To compare two "ACHAR" type of string pointer

1 REPLY 1
SOLVED
Reply
Message 1 of 2
luo.jw
349 Views, 1 Reply

To compare two "ACHAR" type of string pointer

I want to check if the value of "AcDbAttribute->tag()" is equal to the "ACHAR" string that i gived or not. however the operator"==" don`t work. blow is the code that i write:

AcDbAttribute* pAttribute = nullptr;

ACHAR *tagatt=_T("TagName");
pref->openAttribute(pAttribute, attrId, AcDb::kForWrite);

if(tagatt==pAttribute->tag())

{

acutPrintf(_T("blockref 8888exit"));

}

else

{

acutPrintf(_T("blockref 666exit"));

}

;

this part it`ll output: "blockref 666exit"

1 REPLY 1
Message 2 of 2
daniel_cadext
in reply to: luo.jw

use AcString, I.e (AcString::compare (wchar_t *)  == 0)

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta