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...
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.
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!
double uor = mdlModelRef_getUorPerMaster(ACTIVEMODEL);
WPrintfString wStr(L"offset = (%.3f, %.3f)", offset.x / uor, offset.y / uor);