• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    DWF

    Reply
    Contributor
    Posts: 14
    Registered: ‎10-31-2009

    Programmatically read markups of DWFx

    990 Views, 8 Replies
    11-11-2009 02:57 AM
    Hi,

    How can I programmatically read the markups of a DWF(x) page?

    Any sample...

    Thank you
    Jamil
    Please use plain text.
    Active Contributor
    Posts: 45
    Registered: ‎05-08-2009

    Re: Programmatically read markups of DWFx

    11-19-2009 07:00 PM in reply to: jamilnour

    Thank you for your question.
    DWFToolkit currently has no API to read markups.
    But you can use APIs of Autodesk Design Review (ADR) to implement this function.
    The following is the sample code:

    ECompositeViewer.IAdECompositeViewer2 CompositeViewer = (ECompositeViewer.IAdECompositeViewer2)axCExpressViewerControl1.ECompositeViewer;

    ECompositeViewer.IAdSection Section = (ECompositeViewer.IAdSection)CompositeViewer.Section;
    ECompositeViewer.IAdContent3 SectionContent = (ECompositeViewer.IAdContent3)Section.Content;

    AdCommon.IAdCollection Markups = (AdCommon.IAdCollection)SectionContent.get_Objects(2); //2 is to return all markup objects
    foreach (ECompositeViewer.IAdMarkup Markup in Markups)

    {

    AdCommon.IAdCollection MarkupProperties = (AdCommon.IAdCollection)Markup.Properties;

    foreach (AdCommon.IAdProperty MarkupProperty in MarkupProperties)

    {

    //Access each property of a markup...

    }

    }

    ------------------------------------------

    // ObjectType - Used in conjunctions with the Objects property above

    [

    export,

    library_block

    ]

    enum ObjectType

    {

    AllPublishedObjects = 0,

    SelectedPublishedObjects = 1,

    AllMarkupObjects = 2,

    SelectedMarkupObjects = 3

    };

    ------------------------------------------

    You can download ADR from here.
    ADR supplies powerful APIs to process DWF files. Please refer to Autodesk Design Review 2010 API Reference for detailed description of all of the supported APIs and commands in Design Review 2010.
    Please let me know if you have any further questions.

    Please use plain text.
    Contributor
    Posts: 14
    Registered: ‎10-31-2009

    Re: Programmatically read markups of DWFx

    11-20-2009 12:53 AM in reply to: jamilnour
    It is clear now...we will probably need more help when we write the code.

    I have question please:

    Is it possible to build a webservice project using visual studio and ADR API to expose these functionalities?

    Thank you
    Jamil Edited by: jamilnour on Nov 20, 2009 8:55 AM
    Please use plain text.
    Active Contributor
    Posts: 45
    Registered: ‎05-08-2009

    Re: Programmatically read markups of DWFx

    11-24-2009 09:30 PM in reply to: jamilnour

    It's possible to realize the function you want using the technology you suggest.
    Autodesk has a similar product named freewheel which you can find via the following link.

    Please let me know if you have any further questions.

    Please use plain text.
    Contributor
    Posts: 18
    Registered: ‎03-10-2009

    Re: Programmatically read markups of DWFx

    02-16-2010 12:35 PM in reply to: jamilnour
    Hi Jerry,

    Been looking at this thread. You mention its possible to read Markups from a dwf. Is it possible to create Markups using the API? If so please give me a sample.

    Thanks,

    ED
    Please use plain text.
    Active Contributor
    Posts: 45
    Registered: ‎05-08-2009

    Re: Programmatically read markups of DWFx

    02-24-2010 11:40 PM in reply to: jamilnour
    Thank you for your question.

    However, there is no API supplied to create Markups currently.

    Please let me know if you have any further questions.

    Jerry
    Please use plain text.
    New Member
    dbischof216
    Posts: 2
    Registered: ‎02-28-2012

    Re: Programmatically read markups of DWFx

    02-28-2012 05:44 AM in reply to: jamilnour

    Hello I am using the latest API (2012) and trying to get the markups via javascript.  I am trying to find the right objects but the API document is not clear.  Can you please give me the same example with javascript?  Thank you!

    Please use plain text.
    Employee
    Posts: 338
    Registered: ‎03-05-2008

    Re: Programmatically read markups of DWFx

    04-05-2012 02:22 AM in reply to: dbischof216

    Thank you for your question.

     

    Here is the javascript smaple code:

     

    ECompViewer = ADViewer.ECompositeViewer;

    var AllObjects = ECompViewer.Section.Content.Objects(2); //2 is to return all markups, 3 to return only selected markups

    for (iObjects=1;(iObjects<=AllObjects.Count);iObjects++)

      var Props = AllObjects(iObjects).Properties;

      for(iProps=1;(iProps<=Props.Count);iProps++) 

      {

        var Prop = Props(iProps);   

        // ...

      }

    }

     

    Any further question please let me know.



    Herbert He
    SW Engineer
    PSEB-GE- ACRD PSEB
    Autodesk, Inc.
    Please use plain text.
    New Member
    jmatg123
    Posts: 2
    Registered: ‎07-13-2011

    Re: Programmatically read markups of DWFx

    04-19-2012 10:02 AM in reply to: jamilnour

    I noticed the reply that there was no way to programmatically add markups through the Design Review API. But the reply was in 2010. Is there anything now that would allow this? Any sample code?

     

    We are trying to insert rectangular callouts in a dwf for the user through the API. And we would like to fill in the text for them as well. Thanks.

    Please use plain text.