EC属性赋值

<ECProperty propertyName="Name" typeName="string">
            <ECCustomAttributes>
                <PreviousNameArray xmlns="Bentley_Standard_CustomAttributes.01.00">
                    <PreviousNames>
                        <PreviousName>
                            <OldName />
                            <SchemaFullNameKey>TestSchema.01.00</SchemaFullNameKey>
                            <IsNewInThisVersion>True</IsNewInThisVersion>
                        </PreviousName>
                    </PreviousNames>
                    <PreviousNameAlreadySaved>True</PreviousNameAlreadySaved>
                </PreviousNameArray>
                <PropertyPriority xmlns="EditorCustomAttributes.01.00">
                    <Priority>100</Priority>
                </PropertyPriority>
            </ECCustomAttributes>
        </ECProperty>
这是符老师的xml文件其中一段,帮助我成功为元素新建属性,但是在使用符老师提示的PropertyHandler为属性赋值时弹出“不可用”错误,没有初始值的自定义属性无法使用SetValue赋初始值吗?急求,望指导!测试代码如下
Sub test()
    Dim oPH As PropertyHandler
    Set oPH = CreatePropertyHandler(ActiveModelReference.GetElementByID(DLongFromLong(32358)))
    oPH.SelectByAccessString "mingCheng"
    oPH.SetValue "12"
End Sub

Parents Reply Children