示例#1
0
文件: GeoTag.cs 项目: wencesui/GeoTag
        private bool LoadcmbFBSFromPW(ComboBox cmbBox, int iFBSFolderId, ref List <string> oList)
        {
            bool retVal = false;

            try
            {
                int iDocCount = PWApiWrapper.aaApi_SelectDocumentsByProjectId(iFBSFolderId);

                for (int i = 0; i < iDocCount; i++)
                {
                    int iDocId = PWApiWrapper.aaApi_GetDocumentNumericProperty(1, i);

                    string strFBS = string.Empty;

                    if (GetFBSfromDocAttribute(iDocId, iFBSFolderId, ref strFBS))
                    {
                        cmbBox.Items.Add(strFBS);
                        oList.Add(strFBS);
                    }
                }
                retVal = true;
            }
            catch
            {
            }
            return(retVal);
        }
示例#2
0
文件: GeoTag.cs 项目: wencesui/GeoTag
        private bool GetFBSfromDocAttribute(int iDocumentID, int iFBSFolderId, ref string FBS)
        {
            bool retVal = false;

            try
            {
                int iEnvId = PWApiWrapper.aaApi_SelectEnvByProjectId(iFBSFolderId);

                int iCount = 0;

                if (iEnvId == -1 || iEnvId == 0)
                {
                    return(false);
                }
                int iTabNo = PWApiWrapper.aaApi_GetEnvNumericProperty(2, 0);

                int irowCount = PWApiWrapper.aaApi_SelectLinkDataByObject(iTabNo, PWApiWrapper.ObjectTypeForLinkData.Document, iFBSFolderId, iDocumentID, null, ref iCount, null, 0);

                for (int iColIndex = 0; iColIndex < iCount; iColIndex++)
                {
                    string strAttName = PWApiWrapper.aaApi_GetLinkDataColumnStringProperty(PWApiWrapper.LinkDataProperty.ColumnName, iColIndex);
                    if (strAttName == "Number")
                    {
                        FBS = PWApiWrapper.aaApi_GetLinkDataColumnValue(0, iColIndex);

                        return(true);
                    }
                }
            }
            catch
            {
            }

            return(retVal);
        }
示例#3
0
文件: GeoTag.cs 项目: wencesui/GeoTag
        private bool LoadcmbFBS(ComboBox cmbBox, int iFBSFolderId, string strCurrentDgnName)
        {
            bool retVal = false;

            try
            {
                //WS: check if the dgn is opened from PW.
                int iCurrentFolderId = PWApiWrapper.aaApi_GetProjectIdFromFileName2(strCurrentDgnName);

                if (iCurrentFolderId == 0)
                {
                    //WS: for testing outside of PW
                    cmbBox.Items.Add("211000");
                    cmbBox.Items.Add("212000");
                }
                else
                {
                    if (AddInMain.oListFBS != null)
                    {
                        LoadCmbboxFromList(cmbBox, AddInMain.oListFBS);
                    }
                    else
                    {
                        AddInMain.oListFBS = new List <string>();
                        LoadcmbFBSFromPW(cmbBox, iFBSFolderId, ref AddInMain.oListFBS);
                    }
                }
                retVal = true;
            }
            catch
            {
            }
            return(retVal);
        }