How to get the masterOrigin and referenceOrigin form Reference file attached in Master File in Microstation V8?
Sujit Bhunia said:How to get the masterOrigin and referenceOrigin form Reference file attached
What programming language are you using?
Regards, Jon Summers LA Solutions
C programing Language using MDL api
StatusInt mdlModelRef_getGlobalOrigin ( DgnModelRefP modelRef , DPoint3d* pGlobalOrigin );
The master itself describes the all models in a DGN, so you have something this is called "active model". From this you could use the modelrefP. Also you get from each reference a modelRefP this could be used also.
HTH
Mit freundlichen Grüßen / Best regards Volker Hüfner
| AB_DATE Engineering Software | ab-date.de |
Sujit Bhunia said:How to get the masterOrigin and referenceOrigin form Reference file attached using MDL api
There's a number of mdlRefFile_xxx functions. You will find them documented in the MDL Function Reference help file.
mdlRefFile_xxx
#include <refernce.h> #include <msreffil.fdf>
ReferenceFile* refInfo = mdlRefFile_getInfo (attachment); // ReferenceFile includes several nested structs Ref_display* display = &refInfo->display; // Ref_display contains the master origin and reference origin in UORs DPoint3d masterOrigin = display->mast_org; DPoint3d refOrigin = display->ref_org;
Thanks Jon for your reply,But the coordinates i got from this mdl api is far away from the original coordinates of my reference file.
Sujit Bhunia said: the coordinates i got from this mdl api is far away from the original coordinates
You may need to adjust those points by subtracting the global origin.
Also, keep in mind that most MDL functions work with units-of-resolution (UORs), not master units.
Thanks Volker for your reply,But from this mdl api (mdlModelRef_getGlobalOrigin ) i got 0.000000 as a Global orogin,but in my dgn Global origin is something different.
Sujit Bhunia said:y dgn Global origin is something different.
Maybe there is some ACS-System active? Try KeyIn:"go=" to get info to the global origin. Sometimes the dialogs in MicroSation shows "second hand" information.
Sujit Bhunia said:the coordinates i got from this mdl api is far away from the original coordinates of my reference file
It would help to tell us more information to help with our diagnosis. 'Far away' is a little vague...