【C#/C++ ORD中国版】在自定义对象上添加可以随着模型内元素内容随时改变的属性

我想给自定义对象添加这么一个属性:首先他是一个枚举类型;然后,他的内容是当前模型空间中所有Alignment类型元素的名称或者id;最后,当模型中的Alignment类型的元素增加或者减少时,该属性的下来列表框中会自动的增加或删除。
请问这样的功能可以实现吗?如果可以,应该怎么做呢?谢谢

Parents Reply
  • 当然,上面的是静态设置EC的方法,如果是动态设置,那么首先,schema得这样写:

    <ECProperty propertyName="FileName" typeName="string" displayLabel="File Name">

        <ECCustomAttributes>

            <ExtendType xmlns="EditorCustomAttributes.01.00">

                <Name>CimDropdownListItem</Name>

            </ExtendType>

        </ECCustomAttributes>

    </ECProperty>

    然后代码里.net重写:

     virtual bool                OnGetDropdownListItems(System::String^ schemaName, System::String^ className, System::String^ propName, IList<System::String^>^% itemList);

    Answer Verified By: 霄男 宿 

Children