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.
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!
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.
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.