When we create the dwg from Inventor, we have the visualization style for Shaded with Edge.
Even with the Design Review> Option> Model> Color Settings> Model Edge Color = As published
However, when we open the dwf model in Design Review, we always have the Shaded view active.
Question: Is there an Activex control to set as default in Design Review "Shaded with Edges"?
Solved! Go to Solution.
Solved by YuhanZhang. Go to Solution.
Solved by YuhanZhang. Go to Solution.
Solved by WHolzwarth. Go to Solution.
Solved by YuhanZhang. Go to Solution.
If I understand what you're looking for, you want to export models as DWF with the shading style as "Shaded with Edges." From what I know of Design Review, there is no specific function to set the shading style. However, if you go back to the Options > Model, you can uncheck the box "As Published" and change the color to black, which would then treat the model as if you had "Shaded with Edges" active.
Inventor, by default, will publish line colors to be as close to the material color as possible, I think.
The central question is: How to default to Design Review: "Shaded with Edges" and "no lights or lights published".
I just have a simple HTML format file which uses the ADR(Autodesk Design Review) activex control, and I tried it to set the DisplayMode to Shaded with Edges(ie.e SectionType.DisplayMode = 2), and it seems working, I share the code here:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Autodesk Design Review Sample</title>
<script type="text/javascript" language="javascript">
function ListSections()
{
var ECompViewer = ADViewer.ECompositeViewer;
var Sections = ECompViewer.Sections;
var secList = document.getElementById("SectionList");
for (iSection = 1;(iSection <= Sections.Count); iSection++)
{
var Section = Sections(iSection); //Set the section to a separate object
secList.innerHTML += Section.Title + "<BR>";
}
var SectionType = ADViewer.ECompositeViewer.Section.SectionType;
if (SectionType.Name == 'com.autodesk.dwf.eModel')
{
SectionType.DisplayMode = 2;
}
}
</script>
<script type="text/javascript" for="ADViewer" event="OnEndLoadItem(bstrItemType,vData,vResult)">
if (bstrItemType == 'DOCUMENT')
{
//Indicates the document is finished loading
ListSections();
}
</script>
</head>
<body>
<div id="title" style="position:absolute; top:0px; left:0px; width:600px; height:100px; text-align:left; background-color:#ccc"> Autodesk Design Review JavaScript Sample.</br></br> This sample will load a file in Autodesk Design Review, once the DWF has completed loading the ListSections() function will list the pages found in the DWF. </div> <div id="canvas" style="position:absolute; top:100px; left:0px; width:425px; height:400px; text-align:center; background-color:#ccc"> <object id="ADViewer" classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" border="1" width="400" height="400" VIEWASTEXT> <param name="Src" value="Assembly1.dwfx"> </object> </div> <div id="SectionList" style="position:absolute; top:100px; left:425px; width:175px; height:400px; text-align:left; font-size:10pt; background-color:#ccc" > List of Sections:</br></br>
</div>
</body>
</html>
You can save it as a .htm file, and also you need an Assembly1.dwfx in the same folder(or you need to edit in the above code to specify the file path), then you can open the .htm file in IE, and usually there is a dialog at the bottom of IE asks if you want to unblock the activex that you need to agree, then it will show the result like below:
Hope this helps.
Many thanks, Yuhan.
I've tried the HTM file in a common folder together with a file renamed to Assembly1.dwfx, and it worked using IE.
No output could be seen with Firefox, Opera or Chrome.
But the IE window was too small, and I didn't see a different look in ADR 14.0.0.177.
What am I missing?
Walter Holzwarth
Some progress now, after switching the small window to full screen.
Walter Holzwarth
In the code you can change the width and height for the view window size in the <object> </object> tags:
<object id="ADViewer" classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" border="1" width="400" height="400" VIEWASTEXT> <param name="Src" value="Assembly1.dwfx"> </object>
As this sample is to demonstrate how the ADR ActiveX control works, you need to use a browser that supports ActiveX to run the html code, IE is the browser which natively supports ActiveX. You can also create the code in other languages(like VB.net etc.) to work with ADR APIs.
Thanks Yuhan Zhang,
Could you tell me which parameter and variable to adjust the "field of view".
This can be controlled by the Camera, below is the sample html code, you can find the Camera.Field.Set to set the field point to change the field of view:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Autodesk Design Review Sample</title>
<script type="text/javascript" language="javascript">
function ListSections()
{
var ECompViewer = ADViewer.ECompositeViewer;
var Sections = ECompViewer.Sections;
var secList = document.getElementById("SectionList");
for (iSection = 1;(iSection <= Sections.Count); iSection++)
{
var Section = Sections(iSection); //Set the section to a separate object
secList.innerHTML += Section.Title + "<BR>";
}
var SectionType = ADViewer.ECompositeViewer.Section.SectionType;
if (SectionType.Name == 'com.autodesk.dwf.eModel')
{
var Camera = Section.Camera;
var CurField = Camera.Field; //Get the current Field
// zoom the camera into the model.
Camera.Field.Set(80,80); //(CurField.X - 100, CurField.Y - 100);
// Set the new point to zoom in
ADViewer.ECompositeViewer.Section.Camera = Camera; //Set the new camera
SectionType.DisplayMode = 2;
}
}
</script>
<script type="text/javascript" for="ADViewer" event="OnEndLoadItem(bstrItemType,vData,vResult)">
if (bstrItemType == 'DOCUMENT')
{
//Indicates the document is finished loading
ListSections();
}
</script>
</head>
<body>
<div id="title" style="position:absolute; top:0px; left:0px; width:600px; height:100px; text-align:left; background-color:#ccc"> Autodesk Design Review JavaScript Sample.</br></br> This sample will load a file in Autodesk Design Review, once the DWF has completed loading the ListSections() function will list the pages found in the DWF. </div> <div id="canvas" style="position:absolute; top:100px; left:0px; width:425px; height:400px; text-align:center; background-color:#ccc"> <object id="ADViewer" classid="clsid:A662DA7E-CCB7-4743-B71A-D817F6D575DF" border="1" width="900" height="600" VIEWASTEXT> <param name="Src" value="Assembly1.dwfx"> </object> </div> <div id="SectionList" style="position:absolute; top:100px; left:425px; width:175px; height:400px; text-align:left; font-size:10pt; background-color:#ccc" > List of Sections:</br></br>
</div>
</body>
</html>
Dear Yuhan Zhang,
Please have some C# example. We are having difficulty finding the class belonging to DisplayMode.
Thanks,
Dear Yuhan Zhang,
Please have some C# example. We are having difficulty finding the class belonging to DisplayMode.
Thanks,
Can't find what you're looking for? Ask the community or share your knowledge.