Autocad Loader 2016 fails to load dll

Autocad Loader 2016 fails to load dll

dirk.neethling
Advocate Advocate
2,094 Views
9 Replies
Message 1 of 10

Autocad Loader 2016 fails to load dll

dirk.neethling
Advocate
Advocate

Hello,

I wrote a dll (Civil3DInterface.dll) which exports the Alignment object.

I would like this dll to be available for users.

The command is "H".

 

The following PackageContents.xml file in the bundle did not load the dll or install a Ribbon in ACAD Civil 3D.

What is wrong?

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
ProductCode="{9ff03155-a12a-43ad-9feb-9064beafbc66}"
AutodeskProduct="AutoCAD"
Name="Alignment Export"
Description="Alignment Export to Revit"
AppVersion="1.0.0" ProductType="Application">
<Components>
<RuntimeRequirements OS="Win64|Win32" Platform="AutoCAD|ACADM" SeriesMin="R20.0" SeriesMax="R20.0"/>
<ComponentEntry AppName="Civil3DInterface" ModuleName="./Contents/Windows/2015/Civil3DInterface.dll"
AppDescription="." LoadOnCommandInvocation="True" LoadOnRequest="True"
LoadOnAutoCADStartup="True" >
<Commands GroupName="CADTOOLS">
<Command Local="H" Global="H" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>

 

Greetings, Dirk

 

0 Likes
2,095 Views
9 Replies
Replies (9)
Message 2 of 10

_gile
Consultant
Consultant

Hi,

 

First you have to change the Patform attribute value.

The value set in your code makes your app load on AutoCAD (Vanilla) and AutoCAD Mechanical:

 

Platform="AutoCAD|ACADM"

 

 

To only load with Civil 3d, you have to replace it with Civil3d:

 

Platform="Civil3d"

Or to load with AutoCAD and Civil3d:

 

 

Platform="AutoCAD|Civil3d"

Or all AutoCAD based products:

 

 

Platform="AutoCAD*"

 

 

Second if you want to set the 'load reasons' to LoadOnCommandInvocation and LoadOnRequest you should set LoadOnStartup to Fales.

 

For more precision about the PackageContents file, you can read this topic:

http://adndevblog.typepad.com/autocad/2013/01/autodesk-autoloader-white-paper.html



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 10

dirk.neethling
Advocate
Advocate

Hello Gilles,

thanks for the link and the info. I've read the reference, hard to get it all right on the first try.

I fixed the xml, but the Add-Inn still does not appear in ACAD Civil3D, see screenshot attached.

Any other mistakes I am making?

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
ProductCode="{9ff03155-a12a-43ad-9feb-9064beafbc66}"
AutodeskProduct="AutoCAD"
Name="Alignment Export"
Description="Alignment Export to Revit"
AppVersion="1.0.0" ProductType="Application">
<Components>
<RuntimeRequirements OS="Win64|Win32" Platform="AutoCAD|Civil3d" SeriesMin="R20.0" SeriesMax="R20.0"/>
<ComponentEntry AppName="Civil3DInterface" ModuleName="./Contents/Windows/2015/Civil3DInterface.dll"
AppDescription="."
LoadOnAutoCADStartup="True" >
<Commands GroupName="CADTOOLS">
<Command Local="H" Global="H" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>

0 Likes
Message 4 of 10

_gile
Consultant
Consultant

Hi,

 

To have your plug-in appearing in the ribbon, you have to add a partial CUI file to your plug-in which defines this new tab.

You can see this video about creating a partial CUI.

You'll also have to add a ComponentEntry to the Package.Content.xml file.

 

Anyway, your plug-in should work without the ribbon tab. You should be able to call your command directly from the command line.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 5 of 10

dirk.neethling
Advocate
Advocate

Hello Gilles,

OK, thanks for the info on the RIbbon. Just being able to call the command is sufficient for me.

However when I type the command "H" it does not work, in my case it switches to HASH which is not the funciton in my dll. I first have to manually run NETLOAD, then load the dll, then type "H". That is what I was trying to automate via the bundle.

When I have a bundle, does it not automatically load NETLOAD and the dll specified in ModuleName?

Greetings, DIrk

0 Likes
Message 6 of 10

_gile
Consultant
Consultant

Oopss!...

 

It looks like there's something wrong  with SerieMin and SerieMax attributes. "20.0" stands for AutoCAD 2015. for AutoCAD 2016 it have to be "20.1".



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 7 of 10

dirk.neethling
Advocate
Advocate

Hello Gilles,

 

thanks for that pointer, I fixed it to SeriesMin="R20.1" SeriesMax="R20.1".

But the problem unfortunatley persists, it is not loading NETLOAD and the dll.

Regards, dirk

 

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage
SchemaVersion="1.0"
ProductCode="{9ff03155-a12a-43ad-9feb-9064beafbc66}"
AutodeskProduct="AutoCAD"
Name="Alignment Export"
Description="Alignment Export to Revit"
AppVersion="1.0.0" ProductType="Application">
<Components>
<RuntimeRequirements OS="Win64|Win32" Platform="AutoCAD|Civil3d" SeriesMin="R20.1" SeriesMax="R20.1"/>
<ComponentEntry AppName="Civil3DInterface" ModuleName="./Contents/Windows/2015/Civil3DInterface.dll"
AppDescription="."
LoadOnAutoCADStartup="True" >
<Commands GroupName="CADTOOLS">
<Command Local="H" Global="H" />
</Commands>
</ComponentEntry>
</Components>
</ApplicationPackage>

0 Likes
Message 8 of 10

_gile
Consultant
Consultant

Just some shoots in the dark :

  • as you use LoadOnAutoCADstartup, try to remove all the useless Commands node.
  • check the APPAUTOLOAD system variable value
  • is the .bundle folder a valid ApplicationPlugins folder?


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 9 of 10

dirk.neethling
Advocate
Advocate

Hello Gilles,

thanks for the tips. 

 

OK, I removed the Commands node

 

APPAUTOLOAD appears in several places in the registry, I picked out the first 2:

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R19.1\ACAD-D004\Applications\AcadAutoLoader\Commands AppAutoloader
->AcAutoLoaderRes.dll:101

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R20.1\ACAD-F001\Variables\APPAUTOLOAD->(Standard):14

 

I assume the value 14 means the combination of the following?

1

Display all messages when loading plug-in applications

 

4

Load plug-in applications when a new drawing is opened

 

the bundle is under:
C:\ProgramData\Autodesk\ApplicationPlugins, is named "Civil3DInterface.bundle", and contains the subdirectories specified in PackageContents.xml

 

same result.

Regards, dirk

0 Likes
Message 10 of 10

_gile
Consultant
Consultant

The APPAUTOLOAD value (you don't need to read the registry, you can directly get and set it from AutoCAD entering its name) is OK (14 means 2 | 4 | 8).

The bundle folder seems OK.

Sorry I do not find anything else possibly wrong...



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub