Assigning a value to an ITEMTYPE member

Hello,

I would like to automate itemtype property assignment.

To do that, I'm trying to write a small piece of VBA but it seems no functions are available for this usage in the VBA API.

As an old Microstation user, I know we can replace some piece of code by key-ins in many case. I'm going to the macro recorder to see which key-ins I must use and I have something like this :

Sub BmrITEMTYPE()

Dim point As Point3d

CadInputQueue.SendKeyin "MDL KEYIN Bentley.CustomProperties, Bentley.CustomProperties ITEMTYPE ATTACH"

CadInputQueue.SendKeyin "ITEMTYPE SETTINGS DESELECTALL "

CadInputQueue.SendKeyin "ITEMTYPE SETTINGS SELECT Architectural\Stairs"

' Les coordonnées sont en unités principales

point.X = 0.0
point.Y = 0.0
point.Z = 0.0

' Envoyer un point données à la commande actuelle
CadInputQueue.SendDataPoint point, 1

CadInputQueue.SendKeyin "ITEMTYPE SETTINGS DESELECTALL "

CadInputQueue.SendKeyin "ITEMTYPE SETTINGS SELECT Architectural\Stairs"

CadInputQueue.SendKeyin "ITEMTYPE SETTINGS SETVALUE Type abc"

' Envoyer une réinit à la commande actuelle
CadInputQueue.SendReset

CommandState.StartDefaultCommand

End Sub

This macro works on the selected element and the itemtype Architectural\Stairs is correctly attached BUT the value "abc" is not set to the "Type" property.

I have tried manually and it's exactly the same : the property is not modified!

Anybody have an idea to solve this ?

Many thanks in advance !

Philippe

Parents Reply
  • Unknown said:
    In my opinion it's off-topic answer

    I was providing background information for your statement:

    Unknown said:
    I found this bug some time ago, but it seems it was not repaired in Update 1 yet

    VBA is a wrapper around the native APIs.  If there's been no update to those then we can't expect VBA to be different.

    What happens if you attempt to set an element property using the native APIs?

     
    Regards, Jon Summers
    LA Solutions

Children
No Data