├── .gitignore ├── LICENSE ├── OPMNetExt.sln ├── OPMNetExt ├── AssemblyInfo.cpp ├── IDynamicProperty2.h ├── IPropertyManager2.cpp ├── IPropertyManager2.h ├── OPMNetExt.cpp ├── OPMNetExt.rc ├── OPMNetExt.vcxproj ├── OPMNetExt.vcxproj.filters ├── OPMPropertyExtension.cpp ├── OPMPropertyExtension.h ├── OPMPropertyExtensionFactory.cpp ├── OPMPropertyExtensionFactory.h ├── Resource.h ├── StdAfx.cpp ├── StdAfx.h ├── acrxEntryPoint.cpp ├── xOPM.cpp └── xOPM.h ├── OPMNetSample ├── Properties │ └── AssemblyInfo.cs ├── asdkOPMNetExt.dll ├── asdkOPMNetSample.csproj ├── asdkOPMNetSample.dll └── customPropertySample.cs ├── README.md ├── arx-config.props └── arx-net-config.props /.gitignore: -------------------------------------------------------------------------------- 1 | # User-specific files 2 | *.suo 3 | *.user 4 | *.sln.docstates 5 | 6 | # Build results 7 | 8 | [Dd]ebug/ 9 | [Rr]elease/ 10 | x64/ 11 | win32/ 12 | build/ 13 | [Bb]in/ 14 | [Oo]bj/ 15 | 16 | # NuGet Packages 17 | *.nupkg 18 | # The packages folder can be ignored because of Package Restore 19 | **/packages/* 20 | # except build/, which is used as an MSBuild target. 21 | !**/packages/build/ 22 | # Uncomment if necessary however generally it will be regenerated when needed 23 | #!**/packages/repositories.config 24 | 25 | # MSTest test Results 26 | [Tt]est[Rr]esult*/ 27 | [Bb]uild[Ll]og.* 28 | 29 | *_i.c 30 | *_p.c 31 | *.ilk 32 | *.meta 33 | *.obj 34 | *.pch 35 | *.pdb 36 | *.pgc 37 | *.pgd 38 | *.rsp 39 | *.sbr 40 | *.tlb 41 | *.tli 42 | *.tlh 43 | *.tmp 44 | *.tmp_proj 45 | *.log 46 | *.vspscc 47 | *.vssscc 48 | .builds 49 | *.pidb 50 | *.log 51 | *.scc 52 | *.VC.db 53 | 54 | # Visual C++ cache files 55 | ipch/ 56 | *.aps 57 | *.ncb 58 | *.opensdf 59 | *.sdf 60 | *.cachefile 61 | 62 | # Visual Studio profiler 63 | *.psess 64 | *.vsp 65 | *.vspx 66 | 67 | # Guidance Automation Toolkit 68 | *.gpState 69 | 70 | # ReSharper is a .NET coding add-in 71 | _ReSharper*/ 72 | *.[Rr]e[Ss]harper 73 | 74 | # TeamCity is a build add-in 75 | _TeamCity* 76 | 77 | # DotCover is a Code Coverage Tool 78 | *.dotCover 79 | 80 | # Others 81 | .DS_Store* 82 | Thumbs.db 83 | *.bak 84 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Cyrille 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /OPMNetExt.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 2013 4 | VisualStudioVersion = 12.0.40629.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "asdkOPMNetExt", "OPMNetExt\OPMNetExt.vcxproj", "{CD7C7C4F-E267-4E50-96DE-B1945176E84C}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "asdkOPMNetSample", "OPMNetSample\asdkOPMNetSample.csproj", "{0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|Mixed Platforms = Debug|Mixed Platforms 14 | Debug|Win32 = Debug|Win32 15 | Debug|x64 = Debug|x64 16 | Release|Any CPU = Release|Any CPU 17 | Release|Mixed Platforms = Release|Mixed Platforms 18 | Release|Win32 = Release|Win32 19 | Release|x64 = Release|x64 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Any CPU.ActiveCfg = Debug|x64 23 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Any CPU.Build.0 = Debug|x64 24 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 25 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Mixed Platforms.Build.0 = Debug|x64 26 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Win32.ActiveCfg = Debug|Win32 27 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|Win32.Build.0 = Debug|Win32 28 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|x64.ActiveCfg = Debug|x64 29 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Debug|x64.Build.0 = Debug|x64 30 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Any CPU.ActiveCfg = Release|x64 31 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Any CPU.Build.0 = Release|x64 32 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Mixed Platforms.ActiveCfg = Release|x64 33 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Mixed Platforms.Build.0 = Release|x64 34 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Win32.ActiveCfg = Release|Win32 35 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|Win32.Build.0 = Release|Win32 36 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|x64.ActiveCfg = Release|x64 37 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C}.Release|x64.Build.0 = Release|x64 38 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 39 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|Any CPU.Build.0 = Debug|Any CPU 40 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU 41 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU 42 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|Win32.ActiveCfg = Debug|Any CPU 43 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|x64.ActiveCfg = Debug|Any CPU 44 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Debug|x64.Build.0 = Debug|Any CPU 45 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU 48 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|Mixed Platforms.Build.0 = Release|Any CPU 49 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|Win32.ActiveCfg = Release|Any CPU 50 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|x64.ActiveCfg = Release|Any CPU 51 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF}.Release|x64.Build.0 = Release|Any CPU 52 | EndGlobalSection 53 | GlobalSection(SolutionProperties) = preSolution 54 | HideSolutionNode = FALSE 55 | EndGlobalSection 56 | EndGlobal 57 | -------------------------------------------------------------------------------- /OPMNetExt/AssemblyInfo.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillef/OPMNetExt/49dd1080e6d0419b482729c36e187a6e8f485f0f/OPMNetExt/AssemblyInfo.cpp -------------------------------------------------------------------------------- /OPMNetExt/IDynamicProperty2.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | 21 | //- IDynamicProperty2.h 22 | 23 | #pragma once 24 | 25 | using namespace System; 26 | using namespace System::Runtime; 27 | using namespace System::Runtime::InteropServices; 28 | using namespace Autodesk::AutoCAD::Runtime; 29 | using namespace Autodesk::AutoCAD::DatabaseServices; 30 | 31 | #include "dynprops.h" 32 | 33 | namespace Autodesk 34 | { 35 | namespace AutoCAD 36 | { 37 | namespace Windows 38 | { 39 | namespace OPM 40 | { 41 | [InteropServices::Guid("9CAF41C2-CA86-4ffb-B05A-AC43C424D076")] 42 | [InteropServices::InterfaceTypeAttribute(InteropServices::ComInterfaceType::InterfaceIsIUnknown)] 43 | [InteropServices::ComVisible(true)] 44 | public interface class IDynamicProperty2 45 | { 46 | void GetGUID( 47 | [InteropServices::Out] System::Guid% propGUID 48 | ); 49 | void GetDisplayName( 50 | [InteropServices::Out, 51 | InteropServices::MarshalAs( 52 | InteropServices::UnmanagedType::BStr 53 | ) 54 | ] interior_ptr name); 55 | void IsPropertyEnabled( 56 | [InteropServices::In, 57 | InteropServices::MarshalAs( 58 | InteropServices::UnmanagedType::IUnknown 59 | ) 60 | ] Object^ pUnk, 61 | [InteropServices::Out] System::Int32% bEnabled 62 | ); 63 | void IsPropertyReadOnly( 64 | [InteropServices::Out] System::Int32% bReadonly 65 | ); 66 | void GetDescription( 67 | [InteropServices::Out, 68 | InteropServices::MarshalAs( 69 | InteropServices::UnmanagedType::BStr 70 | ) 71 | ] interior_ptr description 72 | ); 73 | void GetCurrentValueName( 74 | [InteropServices::Out, 75 | InteropServices::MarshalAs( 76 | InteropServices::UnmanagedType::BStr 77 | ) 78 | ] interior_ptr name 79 | ); 80 | void GetCurrentValueType( 81 | [InteropServices::Out] ushort% pVarType 82 | ); 83 | void GetCurrentValueData( 84 | [InteropServices::In, 85 | InteropServices::MarshalAs( 86 | InteropServices::UnmanagedType::IUnknown 87 | ) 88 | ] Object^ pUnk, 89 | [InteropServices::In, 90 | InteropServices::Out, 91 | InteropServices::MarshalAs( 92 | InteropServices::UnmanagedType::Struct 93 | ) 94 | ] interior_ptr varData 95 | ); 96 | void SetCurrentValueData( 97 | [InteropServices::In, 98 | InteropServices::MarshalAs( 99 | InteropServices::UnmanagedType::IUnknown 100 | ) 101 | ] Object^ pUnk, 102 | [InteropServices::In, 103 | InteropServices::MarshalAs( 104 | InteropServices::UnmanagedType::Struct 105 | ) 106 | ] Object^ varData 107 | ); 108 | void Connect( 109 | [InteropServices::In, 110 | InteropServices::MarshalAs( 111 | /*IDynamicPropertyNotify2*/ 112 | InteropServices::UnmanagedType::IUnknown 113 | ) 114 | ] Object^ pSink 115 | ); 116 | void Disconnect(); 117 | }; 118 | [InteropServices::Guid( 119 | "975112B5-5403-4197-AFB8-90C6CA73B9E1" 120 | )] 121 | [InteropServices::InterfaceTypeAttribute( 122 | InteropServices::ComInterfaceType::InterfaceIsIUnknown 123 | )] 124 | [InteropServices::ComVisible(true)] 125 | public interface class IDynamicPropertyNotify2 126 | { 127 | void OnChanged( 128 | [InteropServices::In, 129 | InteropServices::MarshalAs( 130 | InteropServices::UnmanagedType::IUnknown 131 | ) 132 | ] Object^ pDynamicProperty 133 | ); 134 | void GetCurrentSelectionSet( 135 | [InteropServices::In, 136 | InteropServices::Out, 137 | InteropServices::MarshalAs( 138 | InteropServices::UnmanagedType::Struct 139 | ) 140 | ] interior_ptr pSelection 141 | ); 142 | }; 143 | } 144 | } 145 | } 146 | } -------------------------------------------------------------------------------- /OPMNetExt/IPropertyManager2.cpp: -------------------------------------------------------------------------------- 1 | #include "StdAfx.h" 2 | #include "IPropertyManager2.h" 3 | 4 | IPropertyManager2::IPropertyManager2(void) 5 | { 6 | } 7 | 8 | IPropertyManager2::~IPropertyManager2(void) 9 | { 10 | } 11 | -------------------------------------------------------------------------------- /OPMNetExt/IPropertyManager2.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2005-2007 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | 21 | #pragma once 22 | 23 | using namespace System; 24 | using namespace System::Runtime; 25 | using namespace System::Runtime::InteropServices; 26 | using namespace Autodesk::AutoCAD::Runtime; 27 | using namespace Autodesk::AutoCAD::DatabaseServices; 28 | 29 | #include "dynprops.h" 30 | 31 | namespace Autodesk 32 | { 33 | namespace AutoCAD 34 | { 35 | namespace Windows 36 | { 37 | namespace OPM 38 | { 39 | [InteropServices::Guid( 40 | "FABC1C70-1044-4aa0-BF8D-91FFF9052715" 41 | )] 42 | [InteropServices::InterfaceTypeAttribute( 43 | InteropServices::ComInterfaceType::InterfaceIsIUnknown 44 | )] 45 | [InteropServices::ComVisible(true)] 46 | 47 | public interface class IPropertyManager2 48 | { 49 | void AddProperty( 50 | [InteropServices::In, 51 | InteropServices::MarshalAs( 52 | InteropServices::UnmanagedType::IUnknown 53 | ) 54 | ] Object^ pDynPropObj 55 | ); 56 | void RemoveProperty( 57 | [InteropServices::In, 58 | InteropServices::MarshalAs( 59 | InteropServices::UnmanagedType::IUnknown 60 | ) 61 | ] Object^ pDynPropObj 62 | ); 63 | void GetDynamicProperty( 64 | [InteropServices::In] long index, 65 | [InteropServices::Out, 66 | InteropServices::MarshalAs( 67 | InteropServices::UnmanagedType::IUnknown 68 | ) 69 | ] interior_ptr value 70 | ); 71 | void GetDynamicPropertyByName( 72 | [InteropServices::In, 73 | InteropServices::MarshalAs( 74 | InteropServices::UnmanagedType::BStr 75 | ) 76 | ] System::String^ name, 77 | [InteropServices::Out, 78 | InteropServices::MarshalAs( 79 | InteropServices::UnmanagedType::IUnknown 80 | ) 81 | ] interior_ptr value 82 | ); 83 | void GetDynamicPropertyCountEx( 84 | [InteropServices::Out] long* count 85 | ); 86 | void GetDynamicClassInfo( 87 | [InteropServices::In, 88 | InteropServices::MarshalAs( 89 | InteropServices::UnmanagedType::IUnknown 90 | ) 91 | ] Object^ pDynPropObj, 92 | [InteropServices::Out, 93 | InteropServices::MarshalAs( 94 | /*InteropServices::UnmanagedType::ITypeInfo*/ 95 | InteropServices::UnmanagedType::IUnknown 96 | ) 97 | ] interior_ptr typeInfo, 98 | [InteropServices::Out] unsigned long* dwCookie 99 | ); 100 | }; 101 | } 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /OPMNetExt/OPMNetExt.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | //- OPMNetExt.cpp : Initialization functions 23 | 24 | #include "StdAfx.h" 25 | #include "resource.h" 26 | 27 | #include "IPropertyManager2.h" 28 | #include "IDynamicProperty2.h" 29 | 30 | //- DLL Entry Point 31 | 32 | #pragma managed(push, off) 33 | extern "C" 34 | BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) 35 | { 36 | //- Remove this if you use lpReserved 37 | 38 | UNREFERENCED_PARAMETER(lpReserved); 39 | 40 | if ( dwReason == DLL_PROCESS_ATTACH ) 41 | { 42 | _hdllInstance =hInstance; 43 | } 44 | else if ( dwReason == DLL_PROCESS_DETACH ) 45 | {} 46 | return (TRUE); 47 | } 48 | #pragma managed(pop) 49 | 50 | -------------------------------------------------------------------------------- /OPMNetExt/OPMNetExt.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillef/OPMNetExt/49dd1080e6d0419b482729c36e187a6e8f485f0f/OPMNetExt/OPMNetExt.rc -------------------------------------------------------------------------------- /OPMNetExt/OPMNetExt.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Debug 10 | x64 11 | 12 | 13 | Release 14 | Win32 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C} 23 | asdkOPMNetExt 24 | arxnet 25 | asdk 26 | asdkOPMNetExt 27 | 8.1 28 | 29 | 30 | 31 | DynamicLibrary 32 | false 33 | false 34 | Unicode 35 | true 36 | 37 | 38 | false 39 | true 40 | 41 | 42 | true 43 | false 44 | 45 | 46 | v140 47 | 48 | 49 | v140 50 | 51 | 52 | v141 53 | 54 | 55 | v141 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | $(OutDir)$(TargetName)$(TargetExt) 67 | 68 | 69 | 70 | 71 | $(OutDir)$(TargetName)$(TargetExt) 72 | 73 | 74 | 75 | 76 | $(OutDir)$(TargetName)$(TargetExt) 77 | 78 | 79 | 80 | 81 | $(OutDir)$(TargetName)$(TargetExt) 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | Create 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /OPMNetExt/OPMNetExt.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {776fc0c3-4568-4526-bb9d-1beee3326716} 6 | cpp;c;cc;cxx;def;idl;odl 7 | 8 | 9 | {96037d9e-74e2-4cc7-bd55-a119224c8169} 10 | h;hh;hxx 11 | 12 | 13 | {516d94e2-6679-4496-b094-70c8b4a79594} 14 | rc;ico;bmp;cur;jpg;gif 15 | 16 | 17 | {3fe47897-2cc1-4838-8e8b-10cee8c0d0db} 18 | reg;rgs;mak;clw;vsdir;vsz;css;inf;vcproj;csproj 19 | 20 | 21 | 22 | 23 | Source Files 24 | 25 | 26 | Source Files 27 | 28 | 29 | Source Files 30 | 31 | 32 | Source Files 33 | 34 | 35 | Source Files 36 | 37 | 38 | Source Files 39 | 40 | 41 | Source Files 42 | 43 | 44 | 45 | 46 | Include Files 47 | 48 | 49 | Include Files 50 | 51 | 52 | Include Files 53 | 54 | 55 | Include Files 56 | 57 | 58 | Include Files 59 | 60 | 61 | Include Files 62 | 63 | 64 | Include Files 65 | 66 | 67 | 68 | 69 | Resource Files 70 | 71 | 72 | -------------------------------------------------------------------------------- /OPMNetExt/OPMPropertyExtension.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | #include "StdAfx.h" 23 | #include "OPMPropertyExtension.h" 24 | 25 | namespace Autodesk 26 | { 27 | namespace AutoCAD 28 | { 29 | namespace Windows 30 | { 31 | namespace OPM 32 | { 33 | Object^ AcMgdOPMPropertyExtension::GetPropertyManager() 34 | { 35 | IUnknown *pUnk = 36 | GetImpObj()->GetPropertyManager(); 37 | return ( 38 | System::Runtime::InteropServices::Marshal::GetObjectForIUnknown( 39 | System::IntPtr(pUnk) 40 | ) 41 | ); 42 | } 43 | 44 | void AcMgdOPMPropertyExtension::SetPropertyManager( 45 | Object^ pPropManager 46 | ) 47 | { 48 | IPropertyManager *pPropMgr = 49 | reinterpret_cast( 50 | System::Runtime::InteropServices::Marshal::GetIUnknownForObject( 51 | pPropManager 52 | ).ToPointer() 53 | ); 54 | GetImpObj()->SetPropertyManager(pPropMgr); 55 | } 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /OPMNetExt/OPMPropertyExtension.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | 21 | #pragma once 22 | 23 | using namespace System; 24 | using namespace System::Runtime; 25 | using namespace System::Runtime::InteropServices; 26 | using namespace Autodesk::AutoCAD::Runtime; 27 | using namespace Autodesk::AutoCAD::DatabaseServices; 28 | 29 | #include "dynprops.h" 30 | 31 | namespace Autodesk 32 | { 33 | namespace AutoCAD 34 | { 35 | namespace Windows 36 | { 37 | namespace OPM 38 | { 39 | [Autodesk::AutoCAD::Runtime::Wrapper( 40 | "OPMPropertyExtension" 41 | )] 42 | public ref class AcMgdOPMPropertyExtension : public RXObject 43 | { 44 | public protected: 45 | AcMgdOPMPropertyExtension( 46 | System::IntPtr unmanagedPointer, 47 | bool bAutoDelete 48 | ) 49 | : RXObject(unmanagedPointer, bAutoDelete) {} 50 | 51 | internal: 52 | //- Returns the unmanaged ARX Object 53 | inline OPMPropertyExtension* GetImpObj() 54 | { 55 | return ( 56 | static_cast( 57 | UnmanagedObject.ToPointer() 58 | ) 59 | ); 60 | } 61 | 62 | public: 63 | virtual Object^ GetPropertyManager(); 64 | virtual void SetPropertyManager(Object^ pPropManager); 65 | }; 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /OPMNetExt/OPMPropertyExtensionFactory.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | #include "StdAfx.h" 23 | #include "OPMPropertyExtensionFactory.h" 24 | 25 | namespace Autodesk 26 | { 27 | namespace AutoCAD 28 | { 29 | namespace Windows 30 | { 31 | namespace OPM 32 | { 33 | AcMgdOPMPropertyExtension^ 34 | AcMgdOPMPropertyExtensionFactory::CreateOPMObjectProtocol( 35 | RXClass^ runtimeClass, long lReserved 36 | ) 37 | { 38 | return ( 39 | gcnew AcMgdOPMPropertyExtension( 40 | System::IntPtr( 41 | GetImpObj()->CreateOPMObjectProtocol( 42 | static_cast( 43 | //runtimeClass->GetImpObj() 44 | runtimeClass->UnmanagedObject.ToPointer() 45 | ), 46 | lReserved 47 | ) 48 | ), 49 | false 50 | ) 51 | ); 52 | } 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /OPMNetExt/OPMPropertyExtensionFactory.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | 21 | #pragma once 22 | 23 | using namespace System; 24 | using namespace System::Runtime; 25 | using namespace System::Runtime::InteropServices; 26 | using namespace Autodesk::AutoCAD::Runtime; 27 | using namespace Autodesk::AutoCAD::DatabaseServices; 28 | 29 | #include "dynprops.h" 30 | #include "OPMPropertyExtension.h" 31 | 32 | namespace Autodesk 33 | { 34 | namespace AutoCAD 35 | { 36 | namespace Windows 37 | { 38 | namespace OPM 39 | { 40 | [Autodesk::AutoCAD::Runtime::Wrapper( 41 | "OPMPropertyExtensionFactory" 42 | )] 43 | public ref class AcMgdOPMPropertyExtensionFactory : public RXObject 44 | { 45 | public protected: 46 | AcMgdOPMPropertyExtensionFactory( 47 | System::IntPtr unmanagedPointer, 48 | bool bAutoDelete 49 | ) 50 | : RXObject(unmanagedPointer, bAutoDelete) {} 51 | 52 | internal: 53 | //- Returns the unmanaged ARX Object 54 | inline OPMPropertyExtensionFactory* GetImpObj() 55 | { 56 | return ( 57 | static_cast( 58 | UnmanagedObject.ToPointer() 59 | ) 60 | ); 61 | } 62 | 63 | public: 64 | virtual AcMgdOPMPropertyExtension^ CreateOPMObjectProtocol( 65 | RXClass^ runtimeClass, 66 | long lReserved 67 | ); 68 | }; 69 | } 70 | } 71 | } 72 | } -------------------------------------------------------------------------------- /OPMNetExt/Resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by OPMNetExt.rc 4 | // 5 | #define IDS_PROJNAME 100 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 32768 13 | #define _APS_NEXT_CONTROL_VALUE 100 14 | #define _APS_NEXT_SYMED_VALUE 102 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /OPMNetExt/StdAfx.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | //------ StdAfx.cpp : source file that includes just the standard includes 23 | //------ StdAfx.pch will be the pre-compiled header 24 | //------ StdAfx.obj will contain the pre-compiled type information 25 | 26 | #include "StdAfx.h" 27 | -------------------------------------------------------------------------------- /OPMNetExt/StdAfx.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | //- StdAfx.h : include file for standard system include files, 23 | //- or project specific include files that are used frequently, 24 | //- but are changed infrequently 25 | 26 | #pragma once 27 | 28 | #pragma pack (push, 8) 29 | #pragma warning(disable: 4786 4996) 30 | //#pragma warning(disable: 4098) 31 | 32 | #include 33 | 34 | //- ObjectARX and OMF headers needs this 35 | 36 | #include 37 | 38 | #using 39 | #using 40 | 41 | #using 42 | #using 43 | 44 | #include 45 | 46 | //- Include ObjectDBX/ObjectARX headers 47 | //- Uncomment one of the following lines to bring a given library in your project. 48 | 49 | //#define _BREP_SUPPORT_ //- Support for the BRep API 50 | //#define _HLR_SUPPORT_ //- Support for the Hidden Line Removal API 51 | //#define _AMODELER_SUPPORT_ //- Support for the AModeler API 52 | //#define _ASE_SUPPORT_ //- Support for the ASI/ASE API 53 | //#define _RENDER_SUPPORT_ //- Support for the AutoCAD Render API 54 | //#define _ARX_CUSTOM_DRAG_N_DROP_ //- Support for the ObjectARX Drag'n Drop API 55 | //#define _INC_LEAGACY_HEADERS_ //- Include legacy headers in this project 56 | 57 | #include "arxHeaders.h" 58 | 59 | #pragma pack (pop) 60 | 61 | -------------------------------------------------------------------------------- /OPMNetExt/acrxEntryPoint.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | //----- acrxEntryPoint.cpp 23 | 24 | #include "StdAfx.h" 25 | #include "resource.h" 26 | 27 | #define szRDS _RXST("asdk") 28 | 29 | //----- ObjectARX EntryPoint 30 | class COPMNetExtApp : public AcRxArxApp { 31 | 32 | public: 33 | COPMNetExtApp() : AcRxArxApp() {} 34 | 35 | virtual AcRx::AppRetCode On_kInitAppMsg(void *pkt) 36 | { 37 | // You *must* call On_kInitAppMsg here 38 | 39 | AcRx::AppRetCode retCode = AcRxArxApp::On_kInitAppMsg(pkt); 40 | 41 | return (retCode); 42 | } 43 | 44 | virtual AcRx::AppRetCode On_kUnloadAppMsg(void *pkt) 45 | { 46 | // You *must* call On_kUnloadAppMsg here 47 | 48 | AcRx::AppRetCode retCode = AcRxArxApp::On_kUnloadAppMsg(pkt); 49 | 50 | return retCode; 51 | } 52 | 53 | virtual void RegisterServerComponents() 54 | {} 55 | }; 56 | 57 | IMPLEMENT_ARX_ENTRYPOINT(COPMNetExtApp) 58 | 59 | -------------------------------------------------------------------------------- /OPMNetExt/xOPM.cpp: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | // 21 | 22 | #include "StdAfx.h" 23 | #include "xOPM.h" 24 | 25 | namespace Autodesk 26 | { 27 | namespace AutoCAD 28 | { 29 | namespace Windows 30 | { 31 | namespace OPM 32 | { 33 | AcMgdOPMPropertyExtensionFactory^ 34 | xOPM::xGET_OPMEXTENSION_CREATE_PROTOCOL() 35 | { 36 | Dictionary^ classDict = 37 | SystemObjects::ClassDictionary; 38 | RXClass^ opmFactoryClass = 39 | (RXClass^)classDict->At("OPMPropertyExtensionFactory"); 40 | RXClass^ dbClass = 41 | (RXClass^)classDict->At("AcDbDatabase"); 42 | return ( 43 | gcnew AcMgdOPMPropertyExtensionFactory( 44 | dbClass->QueryX(opmFactoryClass), 45 | false 46 | ) 47 | ); 48 | } 49 | 50 | Object^ 51 | xOPM::xGET_OPMPROPERTY_MANAGER(RXClass^ pAcRxClass) 52 | { 53 | AcMgdOPMPropertyExtensionFactory^ opmFactory = 54 | xOPM::xGET_OPMEXTENSION_CREATE_PROTOCOL(); 55 | return ( 56 | opmFactory-> 57 | CreateOPMObjectProtocol(pAcRxClass, 0)-> 58 | GetPropertyManager()); 59 | } 60 | } 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /OPMNetExt/xOPM.h: -------------------------------------------------------------------------------- 1 | // (C) Copyright 2008-2009 by Autodesk, Inc. 2 | // 3 | // Permission to use, copy, modify, and distribute this software in 4 | // object code form for any purpose and without fee is hereby granted, 5 | // provided that the above copyright notice appears in all copies and 6 | // that both that copyright notice and the limited warranty and 7 | // restricted rights notice below appear in all supporting 8 | // documentation. 9 | // 10 | // AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 11 | // AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF 12 | // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. AUTODESK, INC. 13 | // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE 14 | // UNINTERRUPTED OR ERROR FREE. 15 | // 16 | // Use, duplication, or disclosure by the U.S. Government is subject to 17 | // restrictions set forth in FAR 52.227-19 (Commercial Computer 18 | // Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii) 19 | // (Rights in Technical Data and Computer Software), as applicable. 20 | 21 | #pragma once 22 | 23 | using namespace System; 24 | using namespace System::Runtime; 25 | using namespace System::Runtime::InteropServices; 26 | using namespace Autodesk::AutoCAD::Runtime; 27 | using namespace Autodesk::AutoCAD::DatabaseServices; 28 | 29 | #include "dynprops.h" 30 | #include "OPMPropertyExtension.h" 31 | #include "OPMPropertyExtensionFactory.h" 32 | 33 | namespace Autodesk 34 | { 35 | namespace AutoCAD 36 | { 37 | namespace Windows 38 | { 39 | namespace OPM 40 | { 41 | public ref class xOPM 42 | { 43 | public protected: 44 | xOPM() {} 45 | 46 | public: 47 | static AcMgdOPMPropertyExtensionFactory^ xGET_OPMEXTENSION_CREATE_PROTOCOL(); 48 | static Object^ xGET_OPMPROPERTY_MANAGER(RXClass^ pAcRxClass); 49 | }; 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /OPMNetSample/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("OPMNetSample")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Autodesk")] 12 | [assembly: AssemblyProduct("OPMNetSample")] 13 | [assembly: AssemblyCopyright("Copyright © Autodesk 2008")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("856b2f38-f480-4d40-b81d-7728b7019fe9")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Revision and Build Numbers 33 | // by using the '*' as shown below: 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /OPMNetSample/asdkOPMNetExt.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillef/OPMNetExt/49dd1080e6d0419b482729c36e187a6e8f485f0f/OPMNetSample/asdkOPMNetExt.dll -------------------------------------------------------------------------------- /OPMNetSample/asdkOPMNetSample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Debug 5 | AnyCPU 6 | 8.0.50727 7 | 2.0 8 | {0EB66A7B-5A6D-49EA-8310-A9C4A87AE1DF} 9 | Library 10 | Properties 11 | asdkOPMNetSample 12 | asdkOPMNetSample 13 | v4.7 14 | 15 | 16 | 17 | 18 | 2.0 19 | 20 | 21 | 22 | true 23 | full 24 | false 25 | .\ 26 | DEBUG;TRACE 27 | prompt 28 | 4 29 | false 30 | 31 | 32 | pdbonly 33 | true 34 | bin\Release\ 35 | TRACE 36 | prompt 37 | 4 38 | false 39 | 40 | 41 | 42 | C:\ObjectARX 2019\inc\AcCoreMgd.dll 43 | False 44 | 45 | 46 | C:\ObjectARX 2019\inc\AcCui.dll 47 | False 48 | 49 | 50 | C:\ObjectARX 2019\inc\AcDbMgd.dll 51 | False 52 | 53 | 54 | C:\ObjectARX 2019\inc\AcMgd.dll 55 | False 56 | 57 | 58 | C:\ObjectARX 2019\inc\AdWindows.dll 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | {CD7C7C4F-E267-4E50-96DE-B1945176E84C} 71 | asdkOPMNetExt 72 | True 73 | 74 | 75 | 76 | 83 | -------------------------------------------------------------------------------- /OPMNetSample/asdkOPMNetSample.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cyrillef/OPMNetExt/49dd1080e6d0419b482729c36e187a6e8f485f0f/OPMNetSample/asdkOPMNetSample.dll -------------------------------------------------------------------------------- /OPMNetSample/customPropertySample.cs: -------------------------------------------------------------------------------- 1 | using Autodesk.AutoCAD.ApplicationServices; 2 | using Autodesk.AutoCAD.Runtime; 3 | using Autodesk.AutoCAD.Windows.OPM; 4 | using System; 5 | using System.Reflection; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace OPMNetSample 9 | { 10 | #region Our Custom Property 11 | [ 12 | Guid("F60AE3DA-0373-4d24-82D2-B2646517ABCB"), 13 | ProgId("OPMNetSample.CustomProperty.1"), 14 | 15 | // No class interface is generated for this class and 16 | // no interface is marked as the default. 17 | // Users are expected to expose functionality through 18 | // interfaces that will be explicitly exposed by the object 19 | // This means the object can only expose interfaces we define 20 | 21 | ClassInterface(ClassInterfaceType.None), 22 | // Set the default COM interface that will be used for 23 | // Automation. Languages like: C#, C++ and VB allow to 24 | //query for interface's we're interested in but Automation 25 | // only aware languages like javascript do not allow to 26 | // query interface(s) and create only the default one 27 | 28 | ComDefaultInterface(typeof(IDynamicProperty2)), 29 | ComVisible(true) 30 | ] 31 | public class CustomProp : IDynamicProperty2 { 32 | private IDynamicPropertyNotify2 m_pSink =null; 33 | 34 | // Unique property ID 35 | void IDynamicProperty2.GetGUID(out Guid propGUID) 36 | { 37 | propGUID = new Guid("F60AE3DA-0373-4d24-82D2-B2646517ABCB"); 38 | } 39 | 40 | // Property display name 41 | void IDynamicProperty2.GetDisplayName(out string szName) 42 | { 43 | szName = "My integer property"; 44 | } 45 | 46 | // Show/Hide property in the OPM, for this object instance 47 | void IDynamicProperty2.IsPropertyEnabled(object pUnk, out int bEnabled) 48 | { 49 | bEnabled = 1; 50 | } 51 | 52 | // Is property showing but disabled 53 | void IDynamicProperty2.IsPropertyReadOnly(out int bReadonly) 54 | { 55 | bReadonly = 0; 56 | } 57 | 58 | // Get the property description string 59 | void IDynamicProperty2.GetDescription(out string szName) 60 | { 61 | szName = "This property is an integer"; 62 | } 63 | 64 | // OPM will typically display these in an edit field 65 | // optional: meta data representing property type name, 66 | // ex. ACAD_ANGLE 67 | void IDynamicProperty2.GetCurrentValueName(out string szName) 68 | { 69 | throw new System.NotImplementedException(); 70 | } 71 | 72 | // What is the property type, ex. VT_R8 73 | void IDynamicProperty2.GetCurrentValueType(out ushort varType) 74 | { 75 | // The Property Inspector supports the following data 76 | // types for dynamic properties: 77 | // VT_I2, VT_I4, VT_R4, VT_R8,VT_BSTR, VT_BOOL 78 | // and VT_USERDEFINED. 79 | 80 | varType = 3; // VT_I4 81 | } 82 | 83 | // Get the property value, passes the specific object 84 | // we need the property value for. 85 | void IDynamicProperty2.GetCurrentValueData(object pUnk, ref object pVarData) 86 | { 87 | // TODO: Get the value and return it to AutoCAD 88 | 89 | // Because we said the value type was a 32b int (VT_I4) 90 | pVarData = (int)4; 91 | } 92 | 93 | // Set the property value, passes the specific object we 94 | // want to set the property value for 95 | void IDynamicProperty2.SetCurrentValueData(object pUnk, object varData) 96 | { 97 | // TODO: Save the value returned to you 98 | 99 | // Because we said the value type was a 32b int (VT_I4) 100 | int myVal = (int)varData; 101 | } 102 | 103 | // OPM passes its implementation of IDynamicPropertyNotify, you 104 | // cache it and call it to inform OPM your property has changed 105 | void IDynamicProperty2.Connect(object pSink) 106 | { 107 | m_pSink = (IDynamicPropertyNotify2)pSink; 108 | } 109 | 110 | void IDynamicProperty2.Disconnect() 111 | { 112 | m_pSink = null; 113 | } 114 | 115 | } 116 | #endregion 117 | 118 | #region Application Entry Point 119 | public class MyEntryPoint : IExtensionApplication { 120 | protected internal CustomProp custProp = null; 121 | 122 | public void Initialize () { 123 | Assembly.LoadFrom("asdkOPMNetExt.dll"); 124 | 125 | // Add the Dynamic Property 126 | Dictionary classDict =SystemObjects.ClassDictionary; 127 | RXClass lineDesc =(RXClass)classDict.At("AcDbLine"); 128 | IPropertyManager2 pPropMan =(IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER(lineDesc); 129 | 130 | custProp =new CustomProp(); 131 | pPropMan.AddProperty((object)custProp); 132 | } 133 | 134 | public void Terminate () { 135 | // Remove the Dynamic Property 136 | Dictionary classDict =SystemObjects.ClassDictionary; 137 | RXClass lineDesc =(RXClass)classDict.At("AcDbLine"); 138 | IPropertyManager2 pPropMan =(IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER(lineDesc); 139 | 140 | pPropMan.RemoveProperty((object)custProp); 141 | custProp =null; 142 | } 143 | 144 | } 145 | #endregion 146 | 147 | } 148 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # OPM.Net Extension 3 | 4 | [![build status](https://img.shields.io/badge/build-passed-blue.svg)](https://github.com/cyrillef/OPMNetExt/tree/master/OPMNetSample) 5 | [![ObjectARX](https://img.shields.io/badge/ObjectARX-2019-blue.svg)](http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=773204) 6 | [![AutoCAD](https://img.shields.io/badge/AutoCAD-2019-green.svg)](http://www.autodesk.com/developautocad) 7 | ![Platforms](https://img.shields.io/badge/platform-windows-lightgray.svg) 8 | [![License](http://img.shields.io/:license-mit-blue.svg)](http://opensource.org/licenses/MIT) 9 | 10 | 11 | ## Motivation 12 | 13 | AutoCAD's Properties Palette - once known as the Object Properties Manager (OPM) - is a very handy 14 | way to display properties inside your application, whether those properties are associated with 15 | individual objects or with the application itself. The Properties Palette uses COM to communicate 16 | with the object(s) in question, and has always required the use of C++ to expose particular interfaces 17 | that control the display of the properties in the palette, so its functionality has not been available 18 | to developers using managed .NET languages such as C# and VB.NET. 19 | There is some portion of the Properties Palette functionality exposed via the 20 | Autodesk.AutoCAD.Windows.ToolPalette namespace, such as the IAcPiPropertyDisplay interface allowing 21 | objects and commands to customize the display of properties in the property inspector window, but 22 | this is far from complete. This library looks at exposing more of the standard Properties Palette 23 | functionality to .NET languages. 24 | 25 | 26 | ## Description 27 | 28 | 29 | 30 | ## Dependencies 31 | 32 | * Visual Studio 2017 33 | * ObjectARX and AutoCAD from 2010 to 2019 34 | 35 | 36 | ## Setup/Usage Instructions 37 | 38 | Please read Kean Walmsley' blog articles on how to use the library. 39 | 40 | - [Exposing AutoCAD's Properties Palette functionality to .NET - Part 1](http://through-the-interface.typepad.com/through_the_interface/2009/03/exposing-autocads-properties-palette-functionality-to-net---part-1.html) 41 | - [Exposing AutoCAD's Properties Palette functionality to .NET - Part 2](http://through-the-interface.typepad.com/through_the_interface/2009/03/exposing-autocads-properties-palette-functionality-to-net---part-2.html) 42 | 43 | 44 | -------- 45 | 46 | ## License 47 | 48 | This sample is licensed under the terms of the [MIT License](http://opensource.org/licenses/MIT). 49 | Please see the [LICENSE](LICENSE) file for full details. 50 | 51 | 52 | ## Written by 53 | 54 | Cyrille Fauvel (Autodesk Developer Network)
55 | http://www.autodesk.com/adn
56 | http://around-the-corner.typepad.com/
-------------------------------------------------------------------------------- /arx-config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <_ProjectFileVersion>16.0 7 | <_PropertySheetDisplayName>ObjectARX 2019 8 | 9 | 10 | 11 | C:\Program Files (x86)\Autodesk\AutoCAD 2016\ 12 | C:\Program Files\Autodesk\AutoCAD 2016\ 13 | acad.exe 14 | accoreconsole.exe 15 | C:\ObjectARX 2019\ 16 | 17 | $(ArxSdkDir)\inc;$(ArxSdkDir)\inc-win32 18 | $(ArxSdkDir)\inc;$(ArxSdkDir)\inc-x64 19 | $(ArxSdkDir)\utils\HlrApi\inc 20 | $(ArxSdkDir)\utils\amodeler\inc 21 | $(ArxSdkDir)\utils\brep\inc 22 | $(ArxSdkDir)\utils\Atil\Inc 23 | 24 | $(ArxSdkDir)\lib-win32 25 | $(ArxSdkDir)\lib-x64 26 | $(ArxSdkDir)\utils\HlrApi\lib-$(Platform) 27 | $(ArxSdkDir)\utils\amodeler\lib-$(Platform) 28 | $(ArxSdkDir)\utils\brep\lib-$(Platform) 29 | $(ArxSdkDir)\utils\Atil\Lib-$(Platform) 30 | 23.0 31 | v140 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | $(ArxSdkIncs);$(ArxHlrIncs);$(ArxAmodelerIncs);$(ArxBrepIncs);$(ArxAtilIncs);$(IncludePath) 46 | $(ArxSdkIncs);$(ReferencePath) 47 | $(ArxSdkLibs);$(ArxHlrLibs);$(ArxAmodelerLibs);$(ArxBrepLibs);$(ArxLibIncs);$(LibraryPath) 48 | 49 | 50 | 51 | 52 | 53 | 54 | Auto 55 | 56 | $(AcadDir)$(AcadExe) 57 | $(ProjectDir) 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | %(AdditionalIncludeDirectories) 66 | $(IntDir)$(TargetName).tlb 67 | %(Filename)_i.h 68 | %(Filename)_i.c 69 | 70 | 71 | _DBXAPP;%(PreprocessorDefinitions) 72 | _CRXAPP;%(PreprocessorDefinitions) 73 | _ACRXAPP;%(PreprocessorDefinitions) 74 | %(AdditionalIncludeDirectories) 75 | $(ArxSdkDir)\inc-$(Platform);%(AdditionalUsingDirectories) 76 | 77 | 78 | _UNICODE;UNICODE;%(PreprocessorDefinitions) 79 | $(IntDir) 80 | 81 | 82 | %(AdditionalDependencies) 83 | %(AdditionalLibraryDirectories) 84 | MachineX86 85 | MachineX64 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /arx-net-config.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | <_ProjectFileVersion>16.0 7 | <_PropertySheetDisplayName>ObjectARX .Net 8 | .dll 9 | 10 | 11 | 12 | 13 | 14 | 15 | v4.0 16 | $(TargetName) 17 | 18 | 19 | 20 | $(ArxSdkIncs);$(ReferencePath) 21 | 22 | 23 | 24 | 25 | 26 | Async 27 | true 28 | Default 29 | ProgramDatabase 30 | 31 | 32 | false 33 | 34 | 35 | false 36 | true 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | --------------------------------------------------------------------------------