AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Map 3D: Dialog PlugIn - Wildcard for Name

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
uso
Contributor
767 Views, 4 Replies

Map 3D: Dialog PlugIn - Wildcard for Name

Hello!

 

We have developed two PlugIns for Industry-Models (PlugIn1.dll & PlugIn1.tbp and PlugIn2.dll & PlugIn2.tbp). And one shared library (Framework.dll).

 

In the shared library are functions, we want to use in both PlugIns (PlugIn1 and PlugIn2).

 

In the *.tbp from PlugIn1 and PlugIn2 call the functions from Framework.dll with follow XML-Tag:

<DialogPlugin AssemblyName="Framework.dll" Namespace="Framework.Interlis2OID" ClassName="Ili2OidDialogPlugIn" />

 

Now, if the PlugIn1 and PlugIn2 be activated in the same Industy-Model, the framework is loaded twice on start the AutoCAD Map 3D.

The effect is, when calling of a dialog this functions in the Framework.dll, that will executed twice.

 

Now, my questions is, can set in the *.tbp file one filter for load the dialog PlugIn.
Example:

in the PlugIn1.tbp = <DialogPlugIn ... Name="FormsP1_*" /> and

in the PlugIn2.tbp = <DialogPlugIn ... Name="FormsP2_*" />

 

I hope you can help me.

Best regards

Urs

 

GEOBOX AG - Urs Sommerhalder
AutoCAD Map 3D
4 REPLIES 4
Message 2 of 5
poulet1212
in reply to: uso

Hi Urs,

 

about your shared library, there is no problem using a shared as long as you put it in the bin foleder of your Map3d application (the same folder than the plugins). This shared dll (framework.dll) should not have to be a plugin but just a common library class (dll).

 

About your plugins, I really encourage you to make a single dll per plugin and define in the 2 tbp files someting like:

 

<DialogPlugin AssemblyName="Plugin1.dll" Namespace="Plugin1.MyNamespace" ClassName="Plugin1" />

<DialogPlugin AssemblyName="Plugin2.dll" Namespace="Plugin2.MyNamespace" ClassName="Plugin2" />

 

then your framework.dll should just be a library class projet that you compile and put the dll in the plugin folder like said above.

 

You should moreover be aware of one thing, the <DialogPlugin tag has a "Name"  attribute that you may use to tell autocad to load your plugin only for some specific Dialogs.

 

For example: <DialogPlugin ... Name="EL_CONDUCTOR"       -> Would load the plugin only for the EL_CONDUCTOR 

<DialogPlugin ... Name="EL_CONDUCTOR,EL_SERVICE_POINT"   I guess it's ok to separate dialog names with comma

 

Because you don't have anything mentionned in the "Name" attribute the plugin load for every Dialog.

 

Up to you !

Regards,

Rémy

Message 3 of 5
uso
Contributor
in reply to: poulet1212

Hi Rémy,

 

Thanks for your reply.

 

The problem is not to load the framework-functions in the PlugIn1 and PlugIn2. This DLL is deployed in the bin-Folder from AutoCAD Map 3D and works fine.

 

In the PlugIn1 and PlugIn2 will be used the framework-function on many dialogs (100 and more).
I will not write all dialog names in the tbp. My idea is, define the "Name" Tag in tbp for load the dialog plugin with wildcard character, e.g. for all electric dialogs Name="EL_*".

Does this works?

 

Best regards

Urs

GEOBOX AG - Urs Sommerhalder
AutoCAD Map 3D
Message 4 of 5
poulet1212
in reply to: uso

Ok I got what you mean now. I can't tell if such a wildcard mechanism exists for the dialogs name, probably not. From there, you could do the following:

 

- Use the default mechanism and load the plugin for every dialog by ommitting the "name" tag or setting Name="".

or

- A more fancy way to achieve this "wildcard" behaviour would be to load the plugin for every dialog, then get programmatically the dialog's name that is opening, look in one DB table (that you will create and will contain wildcards like EL_*). Decide from this DB table if you have to run your code or simply do nothing. This way you could implement this wildcard behaviour you need.

 

Regards,

Rémy

Message 5 of 5
uso
Contributor
in reply to: poulet1212

Hi Rémy,

 

I have asked the same question to ADS-Support, the anwser from Support is: The wildcard in the Tag Name="" is not exists.

Now, the ADN-Support have this request logged in the wish-list for upcoming version.

 

In the meantime I'm develop a similar solution you are suggesting me as second.

 

Thanks for your reply, for me is this case closed.

Best Regards

Urs

GEOBOX AG - Urs Sommerhalder
AutoCAD Map 3D

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

Post to forums  

Autodesk Design & Make Report

”Boost