TheSwamp

Code Red => .NET => Topic started by: www1970 on July 27, 2006, 06:08:55 AM

Title: how to load arx in vbnet?
Post by: www1970 on July 27, 2006, 06:08:55 AM
some selfdefine entity created bu arx ,how to load arx in vbnet?
Title: Re: how to load arx in vbnet?
Post by: MickD on July 27, 2006, 06:13:53 AM
I use this in my IExtensionApplication derived class to load up necessary arx/dbx modules at loading time

Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule("Whatever.arx",true,true);
Title: Re: how to load arx in vbnet?
Post by: www1970 on July 27, 2006, 08:31:18 PM
MickD:
ask a question again
I comprehend this sentence is in program, it is parsed at running, thus when writting program, how to make its function or property display on the hehind of class name ,also how to use it.
can you give me a short code? thanks!
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule("Whatever.arx",true,true);
Title: Re: how to load arx in vbnet?
Post by: MickD on July 27, 2006, 08:50:23 PM
Sure, here's a typical example of using IExtensionApplication interface to intialise some settings or load modules at the time of loading your .net dll

Code: [Select]
//created by MickD 4-1-05

using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.ApplicationServices;


//Set some metadata for autocad and other app's to see what they can use
[assembly:ExtensionApplication(typeof(DCS_3D.App))]
[assembly:CommandClass(typeof(DCS_3D.Commands))]

namespace DCS_3D


{
///
/// The entry point for Autocad, it get's called at least once
/// when you use 'Netload' to load and configure your application
/// There can only be one instance of inherited IExtensionApplication
/// per class library.
///
public class App : IExtensionApplication
{
public void
Initialize()
{
//Let the user know what's happening while loading your app
//You could also alert user of failed loading operations here.
Editor ed =
Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("\n Loading DCS_3D application...\n");

// Load any ARX/DBX modules we may require:
Autodesk.AutoCAD.Runtime.SystemObjects.DynamicLinker.LoadModule("AsdkHlrApi16.dbx",true,true);

}

public void
Terminate()
{
//Nothing to put here;

}
}
}


Title: Re: how to load arx in vbnet?
Post by: Kerry on July 27, 2006, 09:35:20 PM
www1970 ,

Also ,  the NET Labs from AutoDesk discuss   : IExtensionApplication

If you don't have the Labs , or can't find them , please ask.


Title: Re: how to load arx in vbnet?
Post by: Kerry on July 27, 2006, 09:37:58 PM
ahh , you do have them ..
from your post ... http://www.theswamp.org/index.php?topic=11240.msg142801#msg142801
Title: Re: how to load arx in vbnet?
Post by: www1970 on July 28, 2006, 03:12:35 AM
thanks!