.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 7
SRSDS
1285 Views, 6 Replies

Autoloader

I'm trying to get the autoloader working.

http://download.autodesk.com/media/adn/ADN_DevCast_Episode_6/ADN_DevCast_Episode_6.html

Looks like it's a 'fairly' new addition and dead simple but..

 

All I need to do is add a single resource folder in the bundle and to the xml file to be able to access the files in the dll.

Does anyone know how to modify the xml file and refer to this folder in the dll?

 

<?xml version="1.0" encoding="utf-8" ?>
<ApplicationPackage SchemaVersion="1.0" >
  <Components>
    <ComponentEntry
      AppName="DOTNETTEST2"
      ModuleName="./Contents/AutoloaderDotNetSample2.dll"
      LoadOnCommandInvocation="True"
    >
      <Commands GroupName="DevDays2010">
        <Command Global="DOTNETTEST2" Local="DOTNETTEST2" />
      </Commands>
    </ComponentEntry>
  </Components>
</ApplicationPackage>

 I can't remember where I got the resource files from and I can't find many posts on this.

Here is the DevCast for creating the installer.

http://download.autodesk.com/media/adn/DevCasts/ADN_DevCast_Episode_7.html 

 

 

Also is there a way to change the path depending on whether or not you are debugging?

In VB6 I used a function

 

Public Function IsIDE() As Boolean 'Returns boolean value of True if not compiled
       IsIDE = (App.LogMode = 0)
End Function

 

6 REPLIES 6
Message 2 of 7
Anonymous
in reply to: SRSDS

This new Autoloader is great but can be quite picky when not done right and there is no downloadable Schema yet available.

 

I have found that the online help was useful in knowing what Elements were required and what attribute properties were available. You can find the help here:

 

Schema breakdown

http://exchange.autodesk.com/autocad/enu/online-help/search#WS1a9193826455f5ff-4fe3487312ce8a8dba5-7...

 

.bundle folder example

http://exchange.autodesk.com/autocad/enu/online-help/search#WS73099cc142f4875533992bfb12ce8a5f915-7e...

 

HTH,

Message 3 of 7
jeff
in reply to: SRSDS

Those ADn videos are good also look in 2012 help files here

 

http://exchange.autodesk.com/autocad/enu/online-help/browse#WS1a9193826455f5ff-4fe3487312ce8a8dba5-7...

You can also find your answers @ TheSwamp
Message 4 of 7
StephenPreston
in reply to: SRSDS

Its not clear to me what you're trying to do. If you're trying to access a resource DLL from your plug-in DLL, then you should use relative paths in your plug-in code to refer to the location of the resource DLL. If for some reason you need to know at runtime the exact path to your plug-in DLL, then the .NET Assembly class provides a function to return this.

 

Could you give more detail of what you're trying to do?

 

For your second question, the autoloader doesn't differentiate between 'debug' and 'release'. Maybe you could set up a post-build action to copy a different PackageContents.xml file into the bundle with your built DLL depending on the build configuration being used? 

Cheers,

Stephen Preston
Autodesk Developer Network
Message 5 of 7
SRSDS
in reply to: StephenPreston

My project refers to a dwg file and several images which I would like to include in the bundle copied to the ApplicationPlugins folder.

I just can't work out how  to locate them. I get an error if I use:

PictureBox1.Image = System.Drawing.Bitmap.FromFile("../Images/test.png") 

Possibly just something with the syntax i'm using.

Message 6 of 7
StephenPreston
in reply to: SRSDS

If Images is a subfolder to your plug-in DLL location is, isn't the path just "Images\test.png"?

 

Or you can always create an absolute path if you don't trust relative paths, like this:

 

Dim strPath As String = Assembly.GetExecutingAssembly.Location & "\Images\test.png"

Cheers,

Stephen Preston
Autodesk Developer Network
Message 7 of 7
SRSDS
in reply to: StephenPreston

That's what I would expected but I've tried a few locations and keep getting file a not found exception.

Assembly.GetExecutingAssembly.Location is new to me and solved it.

 

I needed to strip the filename out of it. Maybe that's was part of the problem without specifying the full path.

Doesn't matter. Fixed. Thanks!

 

Imports System.Reflection

Imports System.IO

Path.GetDirectoryName(Assembly.GetExecutingAssembly.Location) & "\Resources\test.png"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost