<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic HOW TO Using the Properties Palette to Display Command Properties? in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/how-to-using-the-properties-palette-to-display-command/m-p/12754859#M4074</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

using OPMNetA;
using MDP.OPM.CusDynProps.Roots;

namespace MDP.OPM
{
    public class CusDynPropConfigure
    {
        public static void SetCusDynProp()
        {
            #region 动态属性加载
            Dictionary classDict = SystemObjects.ClassDictionary;
            
            RXClass lineDesc = (RXClass)classDict.At("AcDbPolyLine");
            IPropertyManager2 pPropMan1 = (IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER("_5A_DelTestPost");
            IPropertyManager2 pPropMan2 = (IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER(lineDesc);



            //基础属性
            CusPropRootLongSpec cusPropRootLongSpec = new CusPropRootLongSpec();
            pPropMan1.AddProperty((object)cusPropRootLongSpec);
            pPropMan2.AddProperty((object)cusPropRootLongSpec);

            
            #endregion
        }
    }
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;// (C) Copyright 2005-2007 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "OPMPropertyExtensionNet.h"

//-----------------------------------------------------------------------------
//- Template class that wraps GCHandle from mscorlib.dll
#include &amp;lt;gcroot.h&amp;gt;

//-----------------------------------------------------------------------------
//- autodesk interop header, to aid converting between unmanaged ObjectARX and managed ObjectARX.NET
#include "mgdinterop.h"

//-----------------------------------------------------------------------------
//AATest::OPMNet::OPMPropertyExtensionNet::OPMPropertyExtensionNet () //额外注销
//	: RXObject ((System::IntPtr)new OPMPropertyExtension (), true)//额外注销
//{//额外注销
//}//额外注销

//-----------------------------------------------------------------------------


	namespace OPMNetA {
		OPMPropertyExtensionNet::OPMPropertyExtensionNet(System::IntPtr unmanagedPointer, bool bAutoDelete) : RXObject(unmanagedPointer, bAutoDelete) {}

		Object^ OPMPropertyExtensionNet::GetPropertyManager()
		{
			IUnknown* pUnk = GetImpObj()-&amp;gt;GetPropertyManager();

			return
				(
					System::Runtime::InteropServices::Marshal::GetObjectForIUnknown(System::IntPtr(pUnk))
					);
		}

		void OPMPropertyExtensionNet::SetPropertyManager(Object^ pPropManager)
		{
			IPropertyManager* pPropMgr = reinterpret_cast&amp;lt;IPropertyManager*&amp;gt;(System::Runtime::InteropServices::Marshal::GetIUnknownForObject(pPropManager).ToPointer());

			GetImpObj()-&amp;gt;SetPropertyManager(pPropMgr);
		}

	}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;// (C) Copyright 2005-2007 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "OPMPropertyExtensionFactoryNet.h"

//-----------------------------------------------------------------------------
//- Template class that wraps GCHandle from mscorlib.dll
#include &amp;lt;gcroot.h&amp;gt;

//-----------------------------------------------------------------------------
//- autodesk interop header, to aid converting between unmanaged ObjectARX and managed ObjectARX.NET
#include "mgdinterop.h"

//-----------------------------------------------------------------------------
//AATest::OPMNet::OPMPropertyExtensionFactoryNet::OPMPropertyExtensionFactoryNet () //额外注销
//	: RXObject ((System::IntPtr)new OPMPropertyExtensionFactory (), true)//额外注销
//{//额外注销
//}//额外注销

//-----------------------------------------------------------------------------

	namespace OPMNetA {
		OPMPropertyExtensionFactoryNet::OPMPropertyExtensionFactoryNet(System::IntPtr unmanagedPointer, bool bAutoDelete) : RXObject(unmanagedPointer, bAutoDelete) {}

		OPMPropertyExtensionNet^ OPMPropertyExtensionFactoryNet::CreateOPMObjectProtocol(RXClass^ runtimeClass, long lReserved)
		{
			return
				(
					gcnew OPMPropertyExtensionNet(System::IntPtr(GetImpObj()-&amp;gt;CreateOPMObjectProtocol(static_cast&amp;lt;AcRxClass*&amp;gt;(runtimeClass-&amp;gt;UnmanagedObject.ToPointer()), lReserved)), false)
				);
		}
		OPMPropertyExtensionNet^ OPMPropertyExtensionFactoryNet::CreateOPMCommandProtocol(String^ globalCommand, long lReserved)
		{
			cli::pin_ptr&amp;lt;const System::Char&amp;gt; pChar = PtrToStringChars(globalCommand);
			const wchar_t* psz = pChar;
			return
				(
					gcnew OPMPropertyExtensionNet(System::IntPtr(GetImpObj()-&amp;gt;CreateOPMCommandProtocol(psz, lReserved)), false)
					);
		}
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[CommandMethod("_5A_DelTestPost",&lt;STRONG&gt;CommandFlags.Interruptible&lt;/STRONG&gt;)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I USE&amp;nbsp;OPMNetExt to dbobject to make&amp;nbsp;DynamicProperty，then i want use it to command ，how to make it plz？&lt;/P&gt;</description>
    <pubDate>Mon, 06 May 2024 08:26:51 GMT</pubDate>
    <dc:creator>285552424</dc:creator>
    <dc:date>2024-05-06T08:26:51Z</dc:date>
    <item>
      <title>HOW TO Using the Properties Palette to Display Command Properties?</title>
      <link>https://forums.autodesk.com/t5/net-forum/how-to-using-the-properties-palette-to-display-command/m-p/12754859#M4074</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.EditorInput;

using OPMNetA;
using MDP.OPM.CusDynProps.Roots;

namespace MDP.OPM
{
    public class CusDynPropConfigure
    {
        public static void SetCusDynProp()
        {
            #region 动态属性加载
            Dictionary classDict = SystemObjects.ClassDictionary;
            
            RXClass lineDesc = (RXClass)classDict.At("AcDbPolyLine");
            IPropertyManager2 pPropMan1 = (IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER("_5A_DelTestPost");
            IPropertyManager2 pPropMan2 = (IPropertyManager2)xOPM.xGET_OPMPROPERTY_MANAGER(lineDesc);



            //基础属性
            CusPropRootLongSpec cusPropRootLongSpec = new CusPropRootLongSpec();
            pPropMan1.AddProperty((object)cusPropRootLongSpec);
            pPropMan2.AddProperty((object)cusPropRootLongSpec);

            
            #endregion
        }
    }
}&lt;/LI-CODE&gt;&lt;LI-CODE lang="general"&gt;// (C) Copyright 2005-2007 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "OPMPropertyExtensionNet.h"

//-----------------------------------------------------------------------------
//- Template class that wraps GCHandle from mscorlib.dll
#include &amp;lt;gcroot.h&amp;gt;

//-----------------------------------------------------------------------------
//- autodesk interop header, to aid converting between unmanaged ObjectARX and managed ObjectARX.NET
#include "mgdinterop.h"

//-----------------------------------------------------------------------------
//AATest::OPMNet::OPMPropertyExtensionNet::OPMPropertyExtensionNet () //额外注销
//	: RXObject ((System::IntPtr)new OPMPropertyExtension (), true)//额外注销
//{//额外注销
//}//额外注销

//-----------------------------------------------------------------------------


	namespace OPMNetA {
		OPMPropertyExtensionNet::OPMPropertyExtensionNet(System::IntPtr unmanagedPointer, bool bAutoDelete) : RXObject(unmanagedPointer, bAutoDelete) {}

		Object^ OPMPropertyExtensionNet::GetPropertyManager()
		{
			IUnknown* pUnk = GetImpObj()-&amp;gt;GetPropertyManager();

			return
				(
					System::Runtime::InteropServices::Marshal::GetObjectForIUnknown(System::IntPtr(pUnk))
					);
		}

		void OPMPropertyExtensionNet::SetPropertyManager(Object^ pPropManager)
		{
			IPropertyManager* pPropMgr = reinterpret_cast&amp;lt;IPropertyManager*&amp;gt;(System::Runtime::InteropServices::Marshal::GetIUnknownForObject(pPropManager).ToPointer());

			GetImpObj()-&amp;gt;SetPropertyManager(pPropMgr);
		}

	}&lt;/LI-CODE&gt;&lt;LI-CODE lang="csharp"&gt;// (C) Copyright 2005-2007 by Autodesk, Inc. 
//
// Permission to use, copy, modify, and distribute this software in
// object code form for any purpose and without fee is hereby granted, 
// provided that the above copyright notice appears in all copies and 
// that both that copyright notice and the limited warranty and
// restricted rights notice below appear in all supporting 
// documentation.
//
// AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS. 
// AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
// MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC. 
// DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//
// Use, duplication, or disclosure by the U.S. Government is subject to 
// restrictions set forth in FAR 52.227-19 (Commercial Computer
// Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
// (Rights in Technical Data and Computer Software), as applicable.
//

//-----------------------------------------------------------------------------
#include "StdAfx.h"
#include "OPMPropertyExtensionFactoryNet.h"

//-----------------------------------------------------------------------------
//- Template class that wraps GCHandle from mscorlib.dll
#include &amp;lt;gcroot.h&amp;gt;

//-----------------------------------------------------------------------------
//- autodesk interop header, to aid converting between unmanaged ObjectARX and managed ObjectARX.NET
#include "mgdinterop.h"

//-----------------------------------------------------------------------------
//AATest::OPMNet::OPMPropertyExtensionFactoryNet::OPMPropertyExtensionFactoryNet () //额外注销
//	: RXObject ((System::IntPtr)new OPMPropertyExtensionFactory (), true)//额外注销
//{//额外注销
//}//额外注销

//-----------------------------------------------------------------------------

	namespace OPMNetA {
		OPMPropertyExtensionFactoryNet::OPMPropertyExtensionFactoryNet(System::IntPtr unmanagedPointer, bool bAutoDelete) : RXObject(unmanagedPointer, bAutoDelete) {}

		OPMPropertyExtensionNet^ OPMPropertyExtensionFactoryNet::CreateOPMObjectProtocol(RXClass^ runtimeClass, long lReserved)
		{
			return
				(
					gcnew OPMPropertyExtensionNet(System::IntPtr(GetImpObj()-&amp;gt;CreateOPMObjectProtocol(static_cast&amp;lt;AcRxClass*&amp;gt;(runtimeClass-&amp;gt;UnmanagedObject.ToPointer()), lReserved)), false)
				);
		}
		OPMPropertyExtensionNet^ OPMPropertyExtensionFactoryNet::CreateOPMCommandProtocol(String^ globalCommand, long lReserved)
		{
			cli::pin_ptr&amp;lt;const System::Char&amp;gt; pChar = PtrToStringChars(globalCommand);
			const wchar_t* psz = pChar;
			return
				(
					gcnew OPMPropertyExtensionNet(System::IntPtr(GetImpObj()-&amp;gt;CreateOPMCommandProtocol(psz, lReserved)), false)
					);
		}
	}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[CommandMethod("_5A_DelTestPost",&lt;STRONG&gt;CommandFlags.Interruptible&lt;/STRONG&gt;)]&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I USE&amp;nbsp;OPMNetExt to dbobject to make&amp;nbsp;DynamicProperty，then i want use it to command ，how to make it plz？&lt;/P&gt;</description>
      <pubDate>Mon, 06 May 2024 08:26:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/how-to-using-the-properties-palette-to-display-command/m-p/12754859#M4074</guid>
      <dc:creator>285552424</dc:creator>
      <dc:date>2024-05-06T08:26:51Z</dc:date>
    </item>
  </channel>
</rss>

