PDA

View Full Version : VB.NET and 2005



MikeJarosz
2007-09-12, 04:48 PM
I recently noticed that 2005 has a acdbmgd.dll file.

Does this mean I can write VB.NET code for 2005? Up to now, I have only used VBA with 2005. But I recently returned from the ADN developer camp in Boston with visions of Acad 2008 and Revit API applications. But the bulk of my work is still basically in 2005.

Have I been missing something in 2005?

Ed Jobe
2007-09-12, 04:53 PM
Yes, but 2005 was the first release of the api and its not as complete.

MikeJarosz
2007-09-12, 06:28 PM
WOW!

Another reason to loose sleep. Actually, being new to .NET, I have to learn it. Watching ADN guys in Boston write code right in front of us, I realize there is a lot to learn. It makes it easier when I'm not learning Revit or Acad 2008 at the same time.

dgorsman
2007-09-12, 07:11 PM
WOW!

Another reason to loose sleep. Actually, being new to .NET, I have to learn it. Watching ADN guys in Boston write code right in front of us, I realize there is a lot to learn. It makes it easier when I'm not learning Revit or Acad 2008 at the same time.

Buckle your seatbelt - .NET is not for the faint of heart, especially if you don't have a programming background. I do, and I'm still wrapping my head around some of this stuff. Have *barely* started looking at the AutoCAD side of it... brain... hurts...

Jeff_M
2007-09-12, 08:23 PM
Buckle your seatbelt - .NET is not for the faint of heart, especially if you don't have a programming background. I do, and I'm still wrapping my head around some of this stuff. Have *barely* started looking at the AutoCAD side of it... brain... hurts...Naw, it's not so bad.....as long as you have padded your desk.... slamming of the forehead onto said desk does hurt without the padding.

MikeJarosz
2007-09-12, 09:13 PM
Actually, I have written one NET application for Revit.

You're right though to warn that it is a big step up from VBA. VBA is really for hobbyists. VB.NET is for serious programming. Although I'm not a professional programmer with a degree in computer science, I could have been one. Instead I chose Architecture.:cry:

andersons
2007-11-09, 10:40 AM
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OSGeo.MapGuide;

public partial class _Default : System.Web.UI.Page
{
public string sessionId;
public string webLayout;
public string url;
protected void Page_Load(object sender, EventArgs e)
{
//string config = @"c:Arquivos de programasMapGuideOpenSourceWebServerExtensionswwwwebconfig.ini";
string config = @"c:\Arquivos de programas\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini";

MapGuideApi.MgInitializeWebTier(config);

MgSite site = new MgSite();


MgUserInformation info = new MgUserInformation("Administrator", "admin");
site.Open(info);

site.Open(info);
sessionId = site.CreateSession();


webLayout = "Library://YorPaste/YourLayout.WebLayout";
url = "/mapguide/mapviewerajax/?SESSION=" + sessionId + "&WEBLAYOUT=" + webLayout;
}
}

In CS Page...






<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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 runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor=blue>
<form id="form1" runat="server">

<p>
<asp:Label ID="lblURL" runat="server" Text="Label"></asp:Label>
</p>

<iframe id="viewerFrame"
width="100%"
height="80%"
frameborder="0"
scrolling="no"
src="<% = url %>">
</iframe>

</form>
</body>
</html>



In Aspx html


Sample of code for use Mapguide Enterprise with Visual Studio .NET 2005 C#