Design Review

Reply
Active Member
irfan.tareen
Posts: 7
Registered: ‎07-19-2011
Message 1 of 8 (380 Views)
Accepted Solution

New to Autodesk Programming

380 Views, 7 Replies
07-21-2011 12:06 PM

Hi,

 

    I am new to Autodesk Programming. I have some DWF files that I need to embedd in a Webpage. I am using Visual Studio 2008, Autodesk Design Review 2011.

 

 I am using JavaScript to acces the Active-X control and find the objects in DWF file. These DWF files are files that were used in earlier application which used SVG technology.

 

I am trying to extract the objects as

 

var AllObjects = ADViewer.ECompositeViewer.Section.Content.Objects(0);

 

I get all the objects. Each object is of type "com.autodesk.dwf.eModel"

 

When I am looping through these objects I don't get any related properties or property names.

 

But when I click on DWF file in AutoDesk Design Reveiw tool. I could see under Model following information.

3D Face(5)

Arc(553)

BlockReference)825)

Circle(16)

Door(4)

Ellipse(27)

Line(8392)

Poin(8)

 

are these objects or soemthing else.

 

I am not understanding how I can extract individual Objects and thier Labels.

When I looked into each object it had ID's but no properties or labell values.

 

I can't get enough source material on using Autodesk Design Review 2011 with JavaScript.

 I referenced ADR 2011 API but no help except for few Javascript examples.    

 

Thanks in Adavance

 

Irfan

 

 

 

 

 

 

 

 

Thank you for your question.

 

Above code is correct way to extract hyperlinks information.

 

After revised the code line "for(i = 1; (i < HyperLink.Count); i++) {" as "for(i = 1; (i <= HyperLink.Count); i++) {", I can get expected result with your test file.

 

Please let me know if I can be of any further assistance. 

Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 2 of 8 (367 Views)

Re: New to Autodesk Programming

07-22-2011 02:11 AM in reply to: irfan.tareen

Thank you for your question.

 

Did you continue to iterate through each object properties looking for the label? Please take below sample as a reference.

 

var Props = AllObjects(index).Properties; //Get the properties in the objects collection  

// Iterate through the object properties looking for the material 

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

 {  

    var Prop = Props(iProps);   

 

    //Check the property name  and value

    Prop.Name;

    Prop.Value;

}// end for

 

Hope that helps. Otherwise, please attach your test DWF file here for us to investigate.

 



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
irfan.tareen
Posts: 7
Registered: ‎07-19-2011
Message 3 of 8 (362 Views)

Re: New to Autodesk Programming

07-22-2011 06:07 AM in reply to: herbert.he

Thanks for looking into it.

 

I did tried the code suggested but nothing comes up with that.

 

I am attaching the DWF file that I am working on.

 

I don't know what type of programming this DWF file requires.

 

From this DWF file I would like to extract the room numbers(Labels) that you see on floor plan.

 

Thanks

 

-Irfan

Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 4 of 8 (321 Views)

Re: New to Autodesk Programming

07-25-2011 07:35 PM in reply to: irfan.tareen

Thank you for your feedback.

 

Your attached DWF file  was generated without object properties. That's why the code does not work as expected.

 

Now, there are two ways for you to get what you want.

  1. Re-generate the DWF file with related object properties.

  2. Using DWF Toolkit to parase this DWF file to get content presentation. You can download DWF Toolkit for free from here. For how to DWF Tookit, please start with "readmefirst.htm" in the download package.



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
irfan.tareen
Posts: 7
Registered: ‎07-19-2011
Message 5 of 8 (311 Views)

Re: New to Autodesk Programming

07-26-2011 06:30 AM in reply to: herbert.he

Thanks

 

Second Option: 

I did refered to the toolkit earlier but it was intended for hardcore C++ programmer. The *readmefirst.htm* would agian redirect me to *Autodesk Design Review API Reference* for VB or Javascript programmers which I have already refered.

 

First option

I would like to know how this can be done i.e. regeneration of files DWF files with properties.

 

-Irfan

 

 

 

 

   

Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 6 of 8 (299 Views)

Re: New to Autodesk Programming

07-26-2011 07:32 PM in reply to: irfan.tareen

Thank you for your feedback.

 

How did you generate the file "111-02.dwf"? Is it published from other appliation?

 

By the way, attach another test file which contains object properties for reference.



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Active Member
irfan.tareen
Posts: 7
Registered: ‎07-19-2011
Message 7 of 8 (264 Views)

Re: New to Autodesk Programming

08-05-2011 09:25 AM in reply to: herbert.he

Thanks

 

    I was able to get this file from my client. It looks like this file has hyperlinks embedded for each room and these hyperlinks has site,building,floor and room information embedded in quey string.

 

Since hyperlink presented me with some informaton I wrote this code to extract the info.

varHyperLinks = Section.HyperLinks;

varmsg;

var msg = 'List of HyperLinks in this Section\n\n';

for(x = 1; (x <= HyperLinks.Count); x++) {

varHyperLink = HyperLinks.Item(x);

for(i = 1; (i < HyperLink.Count); i++) {

msg = msg +

'Name = ' + HyperLink.Name(i) + '\n';

msg = msg +

'Link = ' + HyperLink.Link(i) + '\n\n';

}

 

But I am getting 'Link' and 'Name' properties has 'invalid number of parameters.

Attached is the file for investigation.

 Is there any other way to extract these hyperlink information.

 

I would really appreciate.

 

 

Employee
herbert.he
Posts: 338
Registered: ‎03-05-2008
Message 8 of 8 (253 Views)

Re: New to Autodesk Programming

08-08-2011 12:13 AM in reply to: irfan.tareen

Thank you for your question.

 

Above code is correct way to extract hyperlinks information.

 

After revised the code line "for(i = 1; (i < HyperLink.Count); i++) {" as "for(i = 1; (i <= HyperLink.Count); i++) {", I can get expected result with your test file.

 

Please let me know if I can be of any further assistance. 



Herbert He
SW Engineer
PSEB-GE- ACRD PSEB
Autodesk, Inc.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!