How to find the offset of a reference file.

I am trying to find any object that will send me back the offset of a reference file with mvba code. 

I can easily calculate for the rotation and the Attachment.MasterOrigin gives the resultant location after the offset is applied, but I am trying to figure out essentially what the MasterOrigin would be if the file was not rotated and offset.

Parents Reply
  • I am still confused about MasterOrigin and RefOrigin. In some cases, we can't get correct reference offset by using MasterOrigin - RefOrigin.

    Below is a workable approach to get this offset. Simple!

    DPoint3d offset;
    Transform trans;
    double uor = mdlModelRef_getUorPerMaster(ACTIVEMODEL);
    pAttach->GetTransformToParent(trans, false);
    trans.GetTranslation(offset);
    WPrintfString wStr(L"offset = (%.3f, %.3f)", offset.x / uor, offset.y / uor);
    mdlDialog_dmsgsPrint(wStr);



Children
No Data