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: 

New to Autodesk Programming

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
irfan.tareen
683 Views, 7 Replies

New to Autodesk Programming

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

 

 

 

 

 

 

 

 

7 REPLIES 7
Message 2 of 8
herbert.he
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.
Message 3 of 8
irfan.tareen
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

Message 4 of 8
herbert.he
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.
Message 5 of 8
irfan.tareen
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

 

 

 

 

   

Message 6 of 8
herbert.he
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.
Message 7 of 8
irfan.tareen
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.

 

 

Message 8 of 8
herbert.he
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.

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

Post to forums  

Autodesk Design & Make Report