2

I am using following code for read the element attribute from index.But it shown the error like Unable to cast object of type 'System.Object[]' to type 'MicroStationDGN.DataBlock[]'.Is there any problem in my code?

 private string readAttribute(Element ele,int attribIndex)
    {  
        String getStr = "";
        DataBlock[] dtBck = (DataBlock[])ele.GetUserAttributeData(attribIndex);
        if (dtBck.Length != -1)
        {
            dtBck[0].CopyString(getStr, false);
        }
        return getStr;
    }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.