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.
Sean Duphily said:How to find the offset of a reference file
There are two relevant properties of the Attachment object...
Attachment
MasterOrigin
AttachmentOrigin
Regards, Jon Summers LA Solutions
Answer Verified By: Sean Duphily
Thanks Jon...brain was on food deprivation or something. I throwing the wrong calculation on the AttachmentOrigin earlier by mistake, so moved on rather than try and figure out what I was doing wrong. Checking now, I have verified the AttachmentOrigin is the actual origin in UOR before any offsets or rotation is applied.
Thanks again...
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);