.NET

Reply
*Albert Szilvasy
Message 11 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-18-2005 11:36 AM in reply to: *AlmightySR
Yes. I mean the basic runtime. You can get this in 3 ways:

1. You download the .NET 2.0 Beta2 redistributable.
http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx
2. You download the .NET 2.0 Beta2 SDK.
http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx
3. You download one of the VS2005 flavors.
http://lab.msdn.microsoft.com/vs2005/

Albert

"Ed Jobe" wrote in message
news:4849429@discussion.autodesk.com...
Albert, just for clarification purposes, do you mean the framework when you
say ".Net 2.0 beta 2"?

--
----
Ed
----
"Albert Szilvasy" wrote in message
news:4849409@discussion.autodesk.com...
.NET 2.0 Beta2 is very close to being compatible with AutoCAD 2006 (previous
betas and CTP build had a lot more compatibility issues). If you develop
.net applications using VS2005 you *must* run AutoCAD on .NET 2.0 Beta2.

The only problem I'm aware of at this point is an annoying error dialog that
comes up when you run the layer command. The layer dialog will come up after
you hit Ok to the error dialog. This is a bug in .NET 2.0 Beta2 that MS has
already fixed in their internal builds according to their bug tracking
system:

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=cfe99155-48bc-4180-adbc-81c33212cc12

Please let me know if you experience any other issues running AutoCAD on
.NET 2.0 Beta2.

Albert

wrote in message news:4849146@discussion.autodesk.com...
Be sure to edit the acad.exe.config file to use the recommended version of
dotnet. The default is to use the latest version and VS2005 will cause
problems with 2006 based Autodesk based products.

I have heard of one person who could not run the layer command in 2006 (it
is now a dot net ui) after installing VS2005. Editing acad.exe.config fixed
the problem.
*Ed Jobe
Message 12 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-18-2005 12:43 PM in reply to: *AlmightySR
thx

--
----
Ed
----
"Albert Szilvasy" wrote in message
news:4849454@discussion.autodesk.com...
Yes. I mean the basic runtime. You can get this in 3 ways:

1. You download the .NET 2.0 Beta2 redistributable.
http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx
2. You download the .NET 2.0 Beta2 SDK.
http://lab.msdn.microsoft.com/vs2005/downloads/netframework/default.aspx
3. You download one of the VS2005 flavors.
http://lab.msdn.microsoft.com/vs2005/

Albert

"Ed Jobe" wrote in message
news:4849429@discussion.autodesk.com...
Albert, just for clarification purposes, do you mean the framework when you
say ".Net 2.0 beta 2"?

--
----
Ed
----
"Albert Szilvasy" wrote in message
news:4849409@discussion.autodesk.com...
.NET 2.0 Beta2 is very close to being compatible with AutoCAD 2006 (previous
betas and CTP build had a lot more compatibility issues). If you develop
.net applications using VS2005 you *must* run AutoCAD on .NET 2.0 Beta2.

The only problem I'm aware of at this point is an annoying error dialog that
comes up when you run the layer command. The layer dialog will come up after
you hit Ok to the error dialog. This is a bug in .NET 2.0 Beta2 that MS has
already fixed in their internal builds according to their bug tracking
system:

http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=cfe99155-48bc-4180-adbc-81c33212cc12

Please let me know if you experience any other issues running AutoCAD on
.NET 2.0 Beta2.

Albert

wrote in message news:4849146@discussion.autodesk.com...
Be sure to edit the acad.exe.config file to use the recommended version of
dotnet. The default is to use the latest version and VS2005 will cause
problems with 2006 based Autodesk based products.

I have heard of one person who could not run the layer command in 2006 (it
is now a dot net ui) after installing VS2005. Editing acad.exe.config fixed
the problem.
*Mike Tuersley
Message 13 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-18-2005 08:37 PM in reply to: *AlmightySR
Use the tab extension to add a tab to the Options dialog box. Then the
following things happen:

- going into layer manager and it pops a fatal error
- leave AutoCAD and random message appear from acmgd.arx [I believe]
- trying to use a browse for folder dialog in the tab will not bring the
folder dialog to the top so acad hangs

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 14 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-18-2005 08:42 PM in reply to: *AlmightySR
Ewhhh...seems you got the layer mgr issue resolved in your other post.
Kudos Albert!

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Tony Tanzillo
Message 15 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-19-2005 08:11 PM in reply to: *AlmightySR
"Mike Tuersley" wrote

>> trying to use a browse for folder dialog in the tab
>> will not bring the folder dialog to the top so acad hangs

That shouldn't happen. Can you post the code?

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006
http://www.acadxtabs.com
*Mike Tuersley
Message 16 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-20-2005 06:02 AM in reply to: *AlmightySR
Ok, this one was done in VB.NET. Just start a new controls project and have
a class and a user control. The code for the class is below. For the
usercontrol, just add a textbox, a button, and a FolderBrowserDialog
control. The pertinent code here is for the button:

Private Sub BrowseButtons_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnBrowse1.Click, btnBrowse2.Click
'System.Windows.Forms.MessageBox.Show("?")
Me.FolderBrowserDialog1.Description = "Select the folder..."
If Me.FolderBrowserDialog1.ShowDialog(Me.ParentForm) = DialogResult.OK
Then
Select Case sender.name.toupper
Case Is = "BTNBROWSE1" 'browse for drawings
Me.txtDwgPath.Text = Me.FolderBrowserDialog1.SelectedPath
Case Is = "BTNBROWSE2" 'browse for blocks
Me.txtBlkPath.Text = Me.FolderBrowserDialog1.SelectedPath
End Select
End If
End Sub

For the FolderBrowserDialog to "show" all you should need is a call to ME
...ShowDialog(Me) or ShowDialog(Me.ParentForm). This works fine if you
restrict 2006 to using 1.1.4322. If you remove this restriction from the
acad.exe.config file and run with 2.0, the same code fails to display the
FolderBrowserDialog.

CLASS CODE:
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Windows

Public Class OGIDefaults

Implements Autodesk.AutoCAD.Runtime.IExtensionApplication

Private Shared myCtrl As TabExtension

Public Sub Initialize() Implements
Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
'fire up the toolpalette set
Try
'Enable XP
System.Windows.Forms.Application.EnableVisualStyles()
StartInterface()
Catch ex As System.Exception
Console.WriteLine(ex)
End Try
End Sub

Public Sub Terminate() Implements
Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
'handle user closing toolpalette set
myCtrl.Dispose()
End Sub

_
Public Shared Sub StartInterface()
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingOptionDialog,
AddressOf Application_TabbedDialog
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingDraftingSettingsDialog,
AddressOf Application_TabbedDialog
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingCustomizeDialog,
AddressOf Application_TabbedDialog
End Sub

Private Shared Sub Application_TabbedDialog(ByVal sender As Object, ByVal
e As Autodesk.AutoCAD.ApplicationServices.TabbedDialogEventArgs)
myCtrl = New TabExtension
e.AddTab("Ohio Gratings", New
Autodesk.AutoCAD.ApplicationServices.TabbedDialogExtension(myCtrl, _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnOk), _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnCancel), _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnHelp) _
) _
)
End Sub

End Class

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 17 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-20-2005 06:17 AM in reply to: *AlmightySR
Oh! Also implementing this with 2.0 causes the error when trying to run
layer manager which Albert already got MS to fix.

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Albert Szilvasy
Message 18 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-24-2005 10:40 AM in reply to: *AlmightySR
This is a bug in AutoCAD. Add the following code to your user control to
workaround the problem. (Sorry about providing it in C#. My eyes are more
accustomed to this C-ish syntax.)


const int GWL_EXSTYLE = -20;
const int WS_EX_CONTROLPARENT = 0x00010000;
[DllImport("user32.dll")]
private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int
dwNewLong);

[DllImport("user32.dll")]
private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
private static extern IntPtr GetParent(IntPtr hWnd);
protected override void OnLoad(EventArgs e)
{
//workaround bug in AutoCAD: the WS_EX_CONTROLPARENT style is
not set on the tab hosting
//our user control (the parent of the our control). This
confuses user32.dll into hanging in
//an infinite loop. Manually set the style to correct this.
IntPtr hwndParent = GetParent(this.Handle);
SetWindowLong(hwndParent,GWL_EXSTYLE,GetWindowLong(hwndParent,GWL_EXSTYLE)
| WS_EX_CONTROLPARENT);
base.OnLoad (e);
}

Albert
"Mike Tuersley" wrote in message
news:4851606@discussion.autodesk.com...
Ok, this one was done in VB.NET. Just start a new controls project and have
a class and a user control. The code for the class is below. For the
usercontrol, just add a textbox, a button, and a FolderBrowserDialog
control. The pertinent code here is for the button:

Private Sub BrowseButtons_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnBrowse1.Click, btnBrowse2.Click
'System.Windows.Forms.MessageBox.Show("?")
Me.FolderBrowserDialog1.Description = "Select the folder..."
If Me.FolderBrowserDialog1.ShowDialog(Me.ParentForm) = DialogResult.OK
Then
Select Case sender.name.toupper
Case Is = "BTNBROWSE1" 'browse for drawings
Me.txtDwgPath.Text = Me.FolderBrowserDialog1.SelectedPath
Case Is = "BTNBROWSE2" 'browse for blocks
Me.txtBlkPath.Text = Me.FolderBrowserDialog1.SelectedPath
End Select
End If
End Sub

For the FolderBrowserDialog to "show" all you should need is a call to ME
...ShowDialog(Me) or ShowDialog(Me.ParentForm). This works fine if you
restrict 2006 to using 1.1.4322. If you remove this restriction from the
acad.exe.config file and run with 2.0, the same code fails to display the
FolderBrowserDialog.

CLASS CODE:
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.Windows

Public Class OGIDefaults

Implements Autodesk.AutoCAD.Runtime.IExtensionApplication

Private Shared myCtrl As TabExtension

Public Sub Initialize() Implements
Autodesk.AutoCAD.Runtime.IExtensionApplication.Initialize
'fire up the toolpalette set
Try
'Enable XP
System.Windows.Forms.Application.EnableVisualStyles()
StartInterface()
Catch ex As System.Exception
Console.WriteLine(ex)
End Try
End Sub

Public Sub Terminate() Implements
Autodesk.AutoCAD.Runtime.IExtensionApplication.Terminate
'handle user closing toolpalette set
myCtrl.Dispose()
End Sub

_
Public Shared Sub StartInterface()
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingOptionDialog,
AddressOf Application_TabbedDialog
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingDraftingSettingsDialog,
AddressOf Application_TabbedDialog
AddHandler
Autodesk.AutoCAD.ApplicationServices.Application.DisplayingCustomizeDialog,
AddressOf Application_TabbedDialog
End Sub

Private Shared Sub Application_TabbedDialog(ByVal sender As Object, ByVal
e As Autodesk.AutoCAD.ApplicationServices.TabbedDialogEventArgs)
myCtrl = New TabExtension
e.AddTab("Ohio Gratings", New
Autodesk.AutoCAD.ApplicationServices.TabbedDialogExtension(myCtrl, _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnOk), _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnCancel), _
New Autodesk.AutoCAD.ApplicationServices.TabbedDialogAction(AddressOf
myCtrl.OnHelp) _
) _
)
End Sub

End Class

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*Mike Tuersley
Message 19 of 22 (63 Views)

Re: Visual Studio 2005 Beta

05-24-2005 01:20 PM in reply to: *AlmightySR
Thanks, Albert! I can handle either language

-- Mike
___________________________
Mike Tuersley
___________________________
the trick is to realize that there is no spoon...
*David Kurtz
Message 20 of 22 (63 Views)

Re: Visual Studio 2005 Beta

08-18-2005 03:00 PM in reply to: *AlmightySR
CArps wrote:
> Be sure to edit the acad.exe.config file to use the recommended version of dotnet. The default is to use the latest version and VS2005 will cause problems with 2006 based Autodesk based products.
>
> I have heard of one person who could not run the layer command in 2006 (it is now a dot net ui) after installing VS2005. Editing acad.exe.config fixed the problem.

I know this thread is dead(ish) But thanks for posting this morsel.
After installing VS C# beta 2 the layer manger was borked. the
acad.exe.config edit (uncommenting the line) fixed it up nicely.


--
David Kurtz
Peckham & Wright Architects, Inc.
Columbia, Missouri

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community