Problem with creating custom text edited imension

Problem with creating custom text edited imension

Anonymous
Not applicable
406 Views
1 Reply
Message 1 of 2

Problem with creating custom text edited imension

Anonymous
Not applicable

Hi.

I'm trying to create dimention for my grip point, using custom edited text. For example when I use distance editing by AcDbAlignedDimension class I want to support different measures, so user string "10m" means istance 10 meaters, and string "10mm" means 10 millimeaters and so on.

So I try to use setCustomStringFunc to solve this problem, but my function work only when I enter a numeric value (if I enter another sybol it doesn't called). Here the part of me code:

 

void MybObject::dim_gripDimensionFunc(AcDbGripData* pThis, const AcDbObjectId& entId, double dimScale, AcDbDimDataPtrArray& arrDimData)

{

AcDbAlignedDimension *pGradeDim = new AcDbAlignedDimension();
pGradeDim->setDatabaseDefaults(acdbHostApplicationServices()->workingDatabase());
pGradeDim->setNormal(AcGeVector3d::kZAxis);
pGradeDim->setElevation(0.0);
pGradeDim->setInspection(false); //As far as I unerstand it might swich off checking of numeric entering
                               
AcDbDimData *pDimData = new AcDbDimData(pGradeDim);
pDimData->setDimFocal(true);
pDimData->setOwnerId(entId);
pDimData->setDimEditable(true);
       
pDimData->setCustomString(true);
pDimData->setCustomStringFunc(dim_setCustomStringFunc);

 

//dim_setCustomStringFunc - is my function, which might interpritate entered string, but if I unput something ifferent from //number (for example "10m") it doesn't even call this function!
       
pDimData->setAppData(pData);
arrDimData.append(pDimData);

}

 


Thanks.

0 Likes
407 Views
1 Reply
Reply (1)
Message 2 of 2

fenton_webb
Autodesk
Autodesk

Can you explain this in more detail please? Also, have you got a sample application to look at?

 

Finally, can you post some images that show roughly what you are talking about please?

 

Thanks
Fenton Webb

Autodesk Developer Network




Fenton Webb
AutoCAD Engineering
Autodesk

0 Likes