Design Review
Welcome to Autodesk’s Design Review Forums. Share your knowledge, ask questions, and explore popular Design Review topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Sample Code for comparing .dwfx

2 REPLIES 2
Reply
Message 1 of 3
dean0267
887 Views, 2 Replies

Sample Code for comparing .dwfx

Can anybody post some sample codes (C# or VB.NET) including references on how to compare two .dwfx files. please?

I have been searching in this forum and the net but no luck. The Autodesk Design Review API does not provide any sample codes. Sofar I have seen a lot of back and forth discussions, but I would love to see the coding part.

 

thanks in advance,

 

Dean

 

2 REPLIES 2
Message 2 of 3
herbert.he
in reply to: dean0267

Thank you for your question.

 

AdCommon.IAdMarkupEditor3_editor = (AdCommon.IAdMarkupEditor3)axCExpressViewerControl1.MarkupEditor; 

AdCommon.IAdComparator_comparator = (AdCommon.IAdComparator)_editor.Comparator; 

try

{

    _comparator.Compare(firstFile, sectionOfFirstFile, sectionFile, sectionOfSecondFile); 

    AdCommon.eCompareResultStatus status = (AdCommon.eCompareResultStatus)_comparator.CompareResultStatus;

    // eCompareResultStatus:

    //   0: The two section have same contents

    //   1: The two section have different contents

    //   2: The two section are not comparable, they have different size or unit.

    //   3: Comparion fails

 

    AdCommon.IAdCollection resultObjects = _comparator.CompareResultObjects as AdCommon.IAdCollection; 

    foreach (AdCommon.IAdMarkup resultObject in resultObjects)

    {

        // deal with compare results.

    }

}

 

You can also refer to this post for another sample.

 

Please reply back if you have further questions.



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Message 3 of 3
sundaram1087
in reply to: herbert.he

Hi Herbert

 

I am trying to compere the two sheets in Autodesk Design Review using API . Am using the same code as mentioned in vb.net but am getting the some error on that

 

Could you please help on this

Please find my source code 

 

sundaram1087_0-1605531088694.png

 

 

sundaram1087_2-1605531123593.png

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report