Hello!
Here is example of field creation
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase(); AcDbField *pField = new AcDbField(); pField->setEvaluationOption(AcDbField::kAutomatic); pField->setFieldCode ( ACRX_T("%<\\AcObjProp Object(%<\\_ObjId 8796087819200>%).InsertionPoint \\f \"%lu6\">%") , AcDbField::FieldCodeFlag(AcDbField::kObjectReference | AcDbField::kPreserveFields) );
And i don't understand: _ObjId 8796087819200 <- this big value - is object id handle of selected object? If yes, its format - HEX or int? And how can it be so long ?
If it is not object id handle - then what?
Solved! Go to Solution.
Solved by owenwengerd. Go to Solution.
Thanks, but i don't understand - why this value so long? When i draw simple circle - it's object id , as example, 4C in hex - but it's 74 in INT.
So, when i start "field" command and select "Objects" category and then - "Object" - expression tell me:
"%<\AcObjProp Object(%<\_ObjId 140696677801056>%).EntityTransparency>%" - _ObjId ????????
You are confusing Object ID and Handle. They are entirely different values.
So i have: AcDbCircle *pCircle.
I get objectId pCircle->objectId(). Then i need put the object id in the expression string:
%<\AcObjProp Object(%<\_ObjId >%).EntityTransparency>%
So which method of AcDbObjectId class i must call to translate it to string?
You can cast AcDbObjectId to void*, then express the pointer value as an unsigned integer.