Author Topic: More deployment questions, this time regarding the .bundle  (Read 2135 times)

0 Members and 1 Guest are viewing this topic.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
More deployment questions, this time regarding the .bundle
« on: April 09, 2016, 07:09:19 PM »
I’m trying to figure out the .bundle format, but I can’t seem to get it to load.
I’m basing the .bundle from Giles excellent ConverterPalette example, and perusing the Autodesk Knowledge Network.

The contents of the bundle include:
  • .NET DLL
  • CSV files for data
  • .dwtTemplate
I’ve copied the .bundle into

C:\Program Files\Autodesk\ApplicationPlugins - didn’t load.
C:\ProgramData\Autodesk\ApplicationPlugins – didn’t load.

I can see that autocad is loading the other bundles from C:\ProgramData\Autodesk\ApplicationPlugins but for some reason my AID.bundle is not loading.

From the command prompt at startup I can see that the bundles right next to mine are getting loaded.

I’m wondering if I’m not making the PackageContents.xml file, but I’m not sure what it would be. Do I need to include the CSV and dwt file as components in the xml? It seems to me that components are reserved for dll files.

Lastly, is there some tool I should be using to create the .bundle or xml file?

Edit: Download removed.
« Last Edit: April 11, 2016, 03:51:58 PM by Atook »

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: More deployment questions, this time regarding the .bundle
« Reply #1 on: April 10, 2016, 11:04:29 AM »
FYI, I was prompted to not follow the link you provided. Not sure if it was my ISP or Avast, but it wasn't pretty. I ignored the warnings and grabbed the zip, but....

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: More deployment questions, this time regarding the .bundle
« Reply #2 on: April 10, 2016, 11:13:50 AM »
Your bundle loaded for me, as it was shown as being successfully loaded (which does not load the dll since you hav ethe LoadOnCommandInvocation set to True). I then typed one of the commands listed in the bundle and it loaded:
Command: IR_InsValve

Reading Default Sprinklers..
Attempting to open folder: C:\ProgramData\Autodesk\ApplicationPlugins\AID.bundle\Contents
Opening C:\ProgramData\Autodesk\ApplicationPlugins\AID.bundle\Contents\AID_SprinklerTable.csv
Total Lines Read: 3019 - 3019 sprinklers added
Reading Pipes..Attempting to open folder: C:\ProgramData\Autodesk\ApplicationPlugins\AID.bundle\Contents
Opening C:\ProgramData\Autodesk\ApplicationPlugins\AID.bundle\Contents\AID_PipeDatabase.csv
Total Lines Read: 111
110 pipes added

Reading Setting Default Lateral Pipe..
Syncing tool palette
Initialization complete, enjoy!

However, I was then greeted with an unhandled exception error, Object reference not set to an instance of an object.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: More deployment questions, this time regarding the .bundle
« Reply #3 on: April 11, 2016, 03:34:10 AM »
Thanks for the feedback Jeff, I'll need to look into why it doesn't seem to load on my test machine in the same path. At least I know I don't need to beat my head against the keyboard nitpicking the xml file!

I'll need to look into the LoadOnCommandInvocation flag.

The unhandled object is on my end, referring to a palette object that probably wasn't loaded. I'm still working on my architecture there. :)

Regarding the error on my server, it's because it's an https connection, and I apparently don't have the right config for my SSL cert from letsencrypt.  I'm hoping I got it sorted now, but it's hard to tell from inside my network sometimes.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: More deployment questions, this time regarding the .bundle
« Reply #4 on: April 11, 2016, 03:27:32 PM »
Jeff, thanks again for your feedback. Setting the LoadOnCommandInvocation to false allowed me to see that it was in fact loading.

The reason I wasn't getting the commands loaded that I wanted, was because I had accidently left them out of the xml file. Basically any [CommandMethod] in my .NET project should be included in the PackageContents.xml.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Re: More deployment questions, this time regarding the .bundle
« Reply #5 on: April 11, 2016, 03:32:14 PM »
Jeff, thanks again for your feedback. Setting the LoadOnCommandInvocation to false allowed me to see that it was in fact loading.

The reason I wasn't getting the commands loaded that I wanted, was because I had accidently left them out of the xml file. Basically any [CommandMethod] in my .NET project should be included in the PackageContents.xml.
You're welcome. If you have your code doing anything that should be done at startup, I'd leave the commands out of the xml file and just have the add-on load at startup instead of commandinvocation. This does slow down the initial startup of Autocad, but it speeds up the loading of the command...and saves from having to enter 200+ commands to the xml file.

Atook

  • Swamp Rat
  • Posts: 1029
  • AKA Tim
Re: More deployment questions, this time regarding the .bundle
« Reply #6 on: April 11, 2016, 03:52:48 PM »
.. I'd leave the commands out of the xml file and just have the add-on load at startup instead of commandinvocation. This does slow down the initial startup of Autocad, but it speeds up the loading of the command...and saves from having to enter 200+ commands to the xml file.

Great information to have, thanks again!