[MSCE C++]获取参考的偏移值

0419test.dgn

Public void GetAttachmentParameter()
{
    DgnFile::LoadedModelsCollection LoadModelCoollect=ISessionMgr::GetActiveDgnFile()->GetLoadedModelsCollection();
    for (DgnModelP dgnmodel : LoadModelCoollect)
    {
        //得到模型名称
        WString name = dgnmodel->GetModelName();
        mdlOutput_messageCenter(OutputMessagePriority::Info, name.GetWCharCP(), NULL, DgnPlatform::OutputMessageAlert::Dialog);
        
        DgnAttachmentArrayP newAttachmentArrayP = dgnmodel->GetDgnAttachmentsP();

        if (NULL != newAttachmentArrayP)
        {
            for (DgnAttachmentP attachment : *newAttachmentArrayP)
            {
                //得到显示比例
                double DisplayScale = attachment->GetDisplayScale();
                WString Scale = double_to_WString(DisplayScale);
                mdlOutput_messageCenter(OutputMessagePriority::Info, Scale.GetWCharCP(), NULL, DgnPlatform::OutputMessageAlert::Dialog);

                //得到参考原点
                DPoint3dCR RefOrigin = attachment->GetRefOrigin();
                WString WPoint = Point_WstrPoint(RefOrigin);
                mdlOutput_messageCenter(OutputMessagePriority::Info, WPoint.GetWCharCP(), NULL, DgnPlatform::OutputMessageAlert::Dialog);
                
                //得到主原点
                DPoint3d *a = new DPoint3d();
                DPoint3dR location = *a;
                attachment->GetMasterOrigin(location);
                WString WMOPoint = Point_WstrPoint(location);
                mdlOutput_messageCenter(OutputMessagePriority::Info, WMOPoint.GetWCharCP(), NULL, DgnPlatform::OutputMessageAlert::Dialog);
                
            }
            
        }
    }
    

}