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

How to run OPM sample from Kean's blog?

51 REPLIES 51
SOLVED
Reply
Message 1 of 52
elMarko
5247 Views, 51 Replies

How to run OPM sample from Kean's blog?

has anyone tried to get the following sample to run from c# express?

 

re: Modifying an AutoCAD object’s state via a dynamic property defined using .NET

URL:

http://through-the-interface.typepad.com/through_the_interface/2009/05/modifying-an-autocad-objects-...

 

This post has link to sample project for accessing property pallet, but I can't figure out how to make it work.  There is a mixture of c++ and c# and I can't find what modules I have to save to acad's folder (per kean's instructions) and what reference to use to replace the one that doesn't load when I try to run the sample project he supplied.

 

When I run the csproj file in the downloaded sample project a reference comes up "missing"

Warning 1 The referenced component 'OPMNetExt' could not be found.  

There is no OPMNetExt.dll in the downloaded sample, there is an OPMNetExtSample.dll and I placed that in the acad folder as he directed but that isn't the right one.

 

I also get the error:

Error 2 The type or namespace name 'OPM' does not exist in the namespace 'Autodesk.AutoCAD.Windows' (are you missing an assembly reference?) 

 

and the error:

Error 3 The type or namespace name 'IDynamicProperty2' could not be found (are you missing a using directive or an assembly reference?)

 

51 REPLIES 51
Message 2 of 52
kean.walmsley
in reply to: elMarko

You should be able to pick up the compiled C++ module (asdkOPMNetExt.dll) from the win32-bin folder of the appropriate ZIP file (depending on your AutoCAD version). I don't have a 64-bit version, unfortunately.

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 3 of 52
elMarko
in reply to: kean.walmsley

I did copy that to the acad folder and set a reference to it.  However the reference is asdkOPMNetExt, leaving still a OPMNetExt reference in the project as missing....Maybe this has something to do with me being on express version 2008?

fwiw I'm trying the 2009 version first, though I could try both.

where is OPMNetExt object that needs referenced?

 

I'm double clicking OPMNetSample.csproj to start the sample project, is that what I should be doing?

(it ran through the upgrade process and I replaced the references to acdbmgd and acmgd with my local versions in C:\ObjectARX 2010\inc-win32

 

the warning i get now is: Warning 1 The referenced component 'OPMNetExt' could not be found.  
when I try to load OpmNetExt I get the error dialog:

"Path to OPMNetExt.vcproj" cannot be opened because its project type(.vcproj) is not supported by this version of the application.  To open it, please use a version that supports this type of project.

 

I'm lost, sorry.

 

mark

 

Message 4 of 52
kean.walmsley
in reply to: elMarko

OPMNetExt is the logical name the project uses for the asdkOPMNetExt.dll assembly. The project loads just fine for me in Visual Studio 2008 (I haven't tried Express, but I would not expect it to behave differently).

 

Have you tried removing the OPMNetExt reference and re-adding it (by browsing to asdkOPMNetExt.dll)?

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 5 of 52
Jeffrey_H
in reply to: kean.walmsley

"OPMNetExt.vcproj" Are you referencing the project file or ".dll"

 

Reference the ".dll"

You can also find your answers @ TheSwamp
Message 6 of 52
kean.walmsley
in reply to: Jeffrey_H

The DLL. You should not need to touch the Visual C++ project file (.vcproj) at all.

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 7 of 52
Jeffrey_H
in reply to: kean.walmsley

Hey Kean

I noticed this in elmarko's post

 

"Path to OPMNetExt.vcproj" cannot be opened because its project type(.vcproj) is not supported by this version of the application.  To open it, please use a version that supports this type of project.

 

I was just letting him know that was problem and I really enjoy and pick up alot good stuff from your blog.

 

 

You can also find your answers @ TheSwamp
Message 8 of 52
kean.walmsley
in reply to: Jeffrey_H

Thanks, Jeffrey - I replied quickly without realising you'd stepped in. 🙂

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 9 of 52

Dear Kean,

 

could it meanwhile be possible to get a 64 bit Version of the asdkOPMNetExt.dll?

If yes, would it be too unpolite to ask you to tell me how I could get it?

 

Det.

Message 10 of 52

Dear Det,

Just email me at kean.walmsley@autodesk.com - I'll send it to you.

Regards,

Kean


Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 11 of 52
gdaniels2
in reply to: kean.walmsley

Hi,

 

I tried to migrate the sample OPMNetExt 2010 project to AutoCAD 2013 x64 VS2012, but since my visual studio skills are quite low and C++/arx skills non existant, I failed miserably, I tried updating all the header files from the 2013 Object Arx SDK but no luck. (I'm just an AutoCAD user not developer that originally played in the VBA/ActiveX stuff and have now moved over to .NET).

 

This would be a great feature for an amature developer like me to have access to, I have started looking at your blog articles on the display Overrule API which seems to be nice and simple, but I'm thinking I can't really put thoose tools to good use unless I can add additional OPM properties on the objects?

 

Should it be simple for me to take this project and migrate from one AutoCAD version to another without actually having any clue about the C++/Arx parts? Or are there any plans for a wrapper like this to be included directly in AutoCAD .NET api?

 

Many thanks,

 

Graham.

Message 12 of 52
kean.walmsley
in reply to: gdaniels2

Hi Graham,

There are various types of Overrules, some do indeed work well with object properties.

I can send you a version that's been ported to 2013 x64 - send me an email and I'll attach it to my response.

Regards,

Kean


Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 13 of 52
gdaniels2
in reply to: gdaniels2

Many thanks Kean - email sent!

 

Actually my company do have a lot of Arx/C++ developers and ADN professional membership, so I can get one of them to help me port the code next time im in the office! But I'm still a bit concerened about the availability of this functionality in furture versions - should I be?

 

Just to clairfy what I'm thinking this will allow me to do all within .NET....

 

Create overrules on display of objects

Add additional OPM properties on those objects (persisted using xdata)

Add additional grips to objects again using overrules

Can I then rename that object in the OPM (so it looks like a custom object to the user)?

 

Is that how Autodesk intended the Overrule API to be used?

 

Thanks,

 

Graham

 

Message 14 of 52
kean.walmsley
in reply to: gdaniels2

Hi Graham,

 

> Create overrules on display of objects

 

You should be able to do this, already, using a DrawableOverrule. But yes, you can use this in conjunction with data made editable via this module.

 

http://through-the-interface.typepad.com/through_the_interface/2009/04/optimized-overruling-in-autoc...

 

> Add additional OPM properties on those objects (persisted using xdata)

 

Yes: http://through-the-interface.typepad.com/through_the_interface/2009/05/modifying-an-autocad-objects-...

 

> Add additional grips to objects again using overrules

 

Again, independent functionality, but still possible: http://through-the-interface.typepad.com/through_the_interface/2009/08/knowing-when-an-autocad-objec... 

 

> Can I then rename that object in the OPM (so it looks like a custom object to the user)?

 

That may be possible, but I haven't tried it. You should ping ADN on that one, unless someone else here has managed it and can chime in.

 

Regards,

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 15 of 52
89033093792
in reply to: kean.walmsley

Dear Kean! We I faced with exactly the same problem. Cannot launch your code on win7 x64 Autocad Civil 3D 2011/2012. I mean I can build a solution and netload an apliccation but id doesn't work without any exception or message.

Thanks in advance!

Message 16 of 52
kean.walmsley
in reply to: 89033093792

Please send me an email and I'll send you a 64-bit version to try out.

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 17 of 52

Thanks to Cyrille Fauvel for updating the project to make it work with AutoCAD 2016 x64.

 

You can find the source here:

 

https://github.com/cyrillef/OPMNetExt

 

And a release build here:

 

https://github.com/cyrillef/OPMNetExt/tree/master/OPMNetSample

 

Kean



Kean Walmsley

Platform Architect & Evangelist, Autodesk Research

Blog | Twitter
Message 18 of 52
Sgear
in reply to: kean.walmsley

Hi

 

Any change someone have "asdkOPMNetExt.dll" for Autocad 2015 64Bit

 

I download OPM_NET_2010 and try to compile for Autodesk 2015 64Bit

 

I have never use C++

I add  Additional Include Directories = C:\SDK-FDO\ObjectARX 2015\inc

and thing I change to 64Bit

 

I get this warning

 

Error 3 error C3624: 'System::Dynamic::IDynamicMetaObjectProvider': use of this type requires a reference to assembly 'System.Core' c:\sdk-fdo\objectarx 2015\inc\mgdinterop.h 263 1 OPMNetExt
IntelliSense: PCH warning: \StdAfx.cpp 1 1 OPMNetExt

 

Regards

Sgear

Message 19 of 52
Sgear
in reply to: Sgear

 

 

 

I try to Compile to 2015

https://github.com/cyrillef/OPMNetExt

 

 

LNK2038: mismatch detected for _MSC_VER': value '1700' doesn't match value '1800

error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in acrxEntryPoint.obj \rxapi.lib(libinit.obj) asdkOPMNetExt

Message 20 of 52
Alexander.Rivilis
in reply to: Sgear


@Sgear wrote:

 

 

 

I try to Compile to 2015

https://github.com/cyrillef/OPMNetExt

 

 

LNK2038: mismatch detected for _MSC_VER': value '1700' doesn't match value '1800

error LNK2038: mismatch detected for '_MSC_VER': value '1700' doesn't match value '1800' in acrxEntryPoint.obj \rxapi.lib(libinit.obj) asdkOPMNetExt


You have to compile this code only with VS 2012 Update 4

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

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