Announcements

Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.

get comments and attached files from change order

Chiften
Contributor
Contributor

get comments and attached files from change order

Chiften
Contributor
Contributor
hi .I am developing an application using C# for Autodesk Vault .I've gotten Change orders and I want to know how can I get comments and attached files in each comment of a specific change order with vault API. 

thanks.
0 Likes
Reply
Accepted solutions (1)
254 Views
2 Replies
Replies (2)

Chiften
Contributor
Contributor

Can anybody help me?? 

@Markus.Koechl  please help

0 Likes

Markus.Koechl
Autodesk
Autodesk
Accepted solution

Once you get your change order, you can access all related objects using the ChangeOrderGrp object: 

            //get all related entities of an ECO
            Autodesk.Connectivity.WebServices.ChangeOrderService mCoSrvc = mVault.ChangeOrderService;
            Autodesk.Connectivity.WebServices.ChangeOrder mCo = mCoSrvc.GetChangeOrderByNumber("ECO-000010");
            Autodesk.Connectivity.WebServices.ChangeOrderGrp mCoGrp = mCoSrvc.GetChangeOrderGroupByChangeOrderId(mCo.Id);

            //access related files or items (= Records Tab)
            if (mCoGrp.FileIdArray != null)
            {
                Autodesk.Connectivity.WebServices.File[] mFiles = mVault.DocumentService.GetFilesByIds(mCoGrp.FileIdArray);
            }
            if (mCoGrp.ItemIdArray != null)
            {
                Autodesk.Connectivity.WebServices.Item[] mItems = mVault.ItemService.GetItemsByIds(mCoGrp.ItemIdArray);
            }

            //access attached files (= Files Tab)
            if (mCoGrp.AttmtIdArray != null)
            {
                Autodesk.Connectivity.WebServices.File[] mAttdFiles = mVault.DocumentService.GetFilesByIds(mCoGrp.AttmtIdArray);
            }

            //access the ECO's communication thread (= Comments Tab)
            Autodesk.Connectivity.WebServices.ForumService mFrmSrvc = mVault.ForumService;
            Autodesk.Connectivity.WebServices.Msg[] mCoMsgs = mFrmSrvc.GetMessagesByForumId(mCoGrp.ForumId);
            //access the ECO's communication thread (= Comments Tab) including files, attached to comments
            Autodesk.Connectivity.WebServices.MsgGroup[] mCoMsgGrps = mFrmSrvc.GetMessageGroupsByForumId(mCoGrp.ForumId);
            if (mCoMsgGrps !=null)
            {
                foreach (var mMsgGrp in mCoMsgGrps)
                {
                    if (mMsgGrp.FileIdArray != null)
                    {
                        Autodesk.Connectivity.WebServices.File[] mCommentAttmts = mVault.DocumentService.GetFilesByIds(mMsgGrp.FileIdArray);
                    }
                }
                
            }

 



Markus Koechl

Solutions Engineer PDM, Autodesk Central Europe