Fit drawing to window
Moderators: SDS, support, admin
Fit drawing to window
Hello,
I am using Cadviewx from the first release. It used to do this automatically but in the latest version my DWG file does not automatically fit into the window. I can also not find any HTML option (parameter) for this in the help.

all my images are now like this:

But they should look like this:

Regards.
I am using Cadviewx from the first release. It used to do this automatically but in the latest version my DWG file does not automatically fit into the window. I can also not find any HTML option (parameter) for this in the help.

all my images are now like this:

But they should look like this:

Regards.
Re: Fit drawing to window
Hello.
CADViewX allows fit drawing to window for both versions, Lite and Pro. HTML demo projects contain the examples:
- Lite- Pro
Alexander.
CADViewX allows fit drawing to window for both versions, Lite and Pro. HTML demo projects contain the examples:
- Lite
Code: Select all
CADViewX.DoToolButtonClick(4)
Code: Select all
CADViewX.Actions.Item(36).Execute()
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: Fit drawing to window
Hello,
This solution works when you have buttons.
But I want to have the image resized automatically at the moment the HTML opens.
I also need many objects on a single HTML page.
As I am aware currently this is only possible by manually clicking "Fit drawing to window":

Here is also an image of what I want to achieve:

May I say that this works perfectly in CADViewX from 2005.
This solution works when you have buttons.
But I want to have the image resized automatically at the moment the HTML opens.
I also need many objects on a single HTML page.
As I am aware currently this is only possible by manually clicking "Fit drawing to window":

Here is also an image of what I want to achieve:

May I say that this works perfectly in CADViewX from 2005.
-
- Posts: 39
- Joined: 04 Aug 2011, 11:31
- Location: Russia
Re: Fit drawing to window
Hello,
try the following solution:
Mikhail
try the following solution:
Code: Select all
<HTML>
<HEAD>
<TITLE>Example for showing CADViewX Object</TITLE>
<meta name="vs_snapToGrid" content="True">
<meta name="vs_showGrid" content="True">
<script id="clientEventHandlersJS" language="vbscript">
<!--
sub CADViewX_OnAfterLoad
CADViewX.DoToolButtonClick(4)
end sub
sub bodyload
CADViewX.FileName = "http://www.soft-gold.ru/cadsofttools_demo.dxf"
end sub
//-->
</script>
</HEAD>
<BODY onload=bodyload BGCOLOR="steelblue">
<object id=CADViewX height=408 width=568
classid=clsid:F5F6C0A5-0D6F-41F6-932C-BB1D4F3566D5 name=CADViewX
VIEWASTEXT>
</object>
</BODY>
</HTML>
Re: Fit drawing to window
This works but as soon as I put an object into the table it doesn' t work anymore.
Here's the code:
and here is the result:

I still think it would be best to have some kind of a parameter:
PARAM name="ZoomAll"VALUE="1">
Regards.
Here's the code:
Code: Select all
<HTML>
<HEAD>
<TITLE>Example for showing CADViewX Object</TITLE>
<meta name="vs_snapToGrid" content="True">
<meta name="vs_showGrid" content="True">
<script id="clientEventHandlersJS" language="vbscript">
sub CADViewX_OnAfterLoad
CADViewX.DoToolButtonClick(4)
end sub
</script>
</HEAD>
<BODY BGCOLOR="steelblue">
<table>
<tr>
<td>
<object id=CADViewX height=150 width=150
classid=clsid:F5F6C0A5-0D6F-41F6-932C-BB1D4F3566D5 name=CADViewX
VIEWASTEXT>
<PARAM name="FileName" value="http://www.soft-gold.ru/cadsofttools_demo.dxf">
<PARAM name="ToolBarVisible"VALUE="False">
<PARAM name="LayoutsBarVisible"VALUE="False">
<PARAM name="IsWithoutBorder"VALUE="True">
<PARAM name="DrawMode"VALUE="1">
</object>
</td>
</tr>
</table>
<br><br>
<object id=CADViewX height=150 width=150
classid=clsid:F5F6C0A5-0D6F-41F6-932C-BB1D4F3566D5 name=CADViewX
VIEWASTEXT>
<PARAM name="FileName" value="http://www.soft-gold.ru/cadsofttools_demo.dxf">
<PARAM name="ToolBarVisible"VALUE="False">
<PARAM name="LayoutsBarVisible"VALUE="False">
<PARAM name="IsWithoutBorder"VALUE="True">
<PARAM name="DrawMode"VALUE="1">
</object>
</BODY>
</HTML>

I still think it would be best to have some kind of a parameter:
PARAM name="ZoomAll"VALUE="1">
Regards.
Re: Fit drawing to window
I found the solution to this issue.
Here is the code that works fine:
Here is the code that works fine:
Code: Select all
<HTML>
<HEAD>
<TITLE>Example for showing CADViewX Object</TITLE>
<meta name="vs_snapToGrid" content="True">
<meta name="vs_showGrid" content="True">
<script type="text/javascript">
function CADViewXResetParameters()
{
var CADViewXObjectArray = document.getElementsByName('CADViewX');
for (var i = 0; CADViewXObjectArray[i]; i++)
{
CADViewXObjectArray[i].DoToolButtonClick(4);
}
}
</script>
</HEAD>
<BODY BGCOLOR="steelblue" onload ="javascript:CADViewXResetParameters()">
<table>
<tr>
<td>
<object id=CADViewX height=150 width=150
classid=clsid:F5F6C0A5-0D6F-41F6-932C-BB1D4F3566D5 name=CADViewX
VIEWASTEXT>
<PARAM name="FileName" value="http://www.soft-gold.ru/cadsofttools_demo.dxf">
<PARAM name="ToolBarVisible"VALUE="False">
<PARAM name="LayoutsBarVisible"VALUE="False">
<PARAM name="IsWithoutBorder"VALUE="True">
<PARAM name="DrawMode"VALUE="1">
</object>
</td>
</tr>
</table>
<br><br>
<object id=CADViewX height=150 width=150
classid=clsid:F5F6C0A5-0D6F-41F6-932C-BB1D4F3566D5 name=CADViewX
VIEWASTEXT>
<PARAM name="FileName" value="http://www.soft-gold.ru/cadsofttools_demo.dxf">
<PARAM name="ToolBarVisible"VALUE="False">
<PARAM name="LayoutsBarVisible"VALUE="False">
<PARAM name="IsWithoutBorder"VALUE="True">
<PARAM name="DrawMode"VALUE="1">
</object>
</BODY>
</HTML>
Re: Fit drawing to window
Hello.
That's correct, DoToolButtonClick affects CADViewX owner object only.
Alexander.
That's correct, DoToolButtonClick affects CADViewX owner object only.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support