ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

acdb references in UserControl having Designer Issues

4 REPLIES 4
Reply
Message 1 of 5
jessaskey
724 Views, 4 Replies

acdb references in UserControl having Designer Issues

Hi All...

 

I have a custom UserControl in C# that utilizes the following ACAD classes..

 

Autodesk.AutoCAD.Windows.ColorDialog

Autodesk.AutoCAD.DatabaseServices.LineWeight

 

I use these to select ACAD Colors and LineWeights in my user interface.

 

These require references to...

 

acmgd.dll

acdbmgd.dll

 

which are both referenced to the .dll's in the ObjectARX 2012 directory at

 

C:\ObjectARX 2012\inc-x64

 

both references are set 'Copy Local' = false so I don't drag the acad dll's around with my program which I believe is the suggested configuration for these references.

 

When I drag one of my user controls onto a control in Visual Studio Design mode.. I get an error stating..

 

System.IO.FileNotFoundException: Could not load file or assembly 'Acdbmgd, Version=18.2.0.0, Culture=Neurtral, PublicKeyToken=null' or one of its dependencies.

 

I have attached the pic of the full dialog. Unfortunately, I can't cut and paste the error, nor can I get the longer error to actually log anywhere using the COM Error Interface in Windows.

 

Now, since I know it can find the actual acdbmgd, I figure it can't find the core C++ .dlls that that this managed wrapper depends upon. Can anyone help me determine which acad dll's that the managed wrapper require and how I should deal with adding them to the search paths of the project??

 

I added reference search paths in the project to both

 

C:\ObjectARX 2012\inc-x64

 

and

 

C:\Program Files\Autodesk\AutoCAD P&ID 2012 - English

 

which I didn't think was a good idea, but I thought it would work.. but it didn't... same error.

 

I searched through the managed development documentation and didn't see any mention of this scenario, so Im trying here as Im at a dead end trying to get this to work out. I think Im close... but oh so far away.

 

thank you

jess

4 REPLIES 4
Message 2 of 5
baillod
in reply to: jessaskey

I have the same problem. Did you find a solution till since 2012?

 

Claude

Message 3 of 5

Hi,

I'm not a .net expert but since nobody else answers...

In my mind, it is not possible to create such controls at design time: since you depend (event not directly) to either acmgd.dll or acdbmgd.dll, creating an instance of your control would require acad runtime to be loaded. Indeed, both dll's are C++/CLI .net wrappers to native acad api. BTW, this is why there is x64 and win32 versions (instead of multi-platform).

Visual studio would then require acad to run in order to create your control instance - this would require a cross-process link between VS and acad and a compatible target platform.

 

This has to be confirmed by a .net expert but I think the only way to create an instance of your control is to create it dynamically at runtime.

 

I hope it helps.

20-20 CAD / 20-20 Technologies
Message 4 of 5

Thanks for your answer,

 

I confirm that when the usercontrol is created dynamically at runtime, it's work fine. The Visual Studio Designer can't manage at design time the acdbmgd.dll.

Message 5 of 5
jess
in reply to: invalid.loic.jourdan

I think you are spot on with this advice....I haven't found a great way around this so far. Thank you.

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

Post to forums  

Autodesk Design & Make Report

”Boost