vba drop tags to text

I've been advised to post the below question in a specific vba forum rather than in the general microstation forum. Since the question applies to both v8i and XM release, I hope for understanding that I will post it in both forums.

 

Dear community,

I am currently writing a vba script, and at a certain point of a longer procedure I want to copy a tag and drop the copied element to a text element.

The copying works fine, it returns another Ustn Element Type 37 / tag (which looses its linkage as shown with the 'broken' symbology) , that's how it should be.

Now surprisingly the Element.IsDroppableElement returns false.

I would prefer a solution other than using CadInputQueue in conjunction with the command 'change tags droptext', as using this option slows down the execution of the routine notably.

Thank you in advance for any helpful hints.

Andreas

Parents
  • TagElements are not TextElements

    The simple answer is that TagElements are not some complex form of TextElements and cannot be 'dropped' to text, irrespective of what MicroStation's user interface may lead you believe. To put it another way, there is no TagElement.Drop method.

    However, a reasonable answer is not far away. A TagElement can store various types of data (in VBA terms, a TagElement may be a String, Integer, or Double). The TagElement.Value property gets the internal value of the tag as a VB Variant type.

    To 'drop' a TagElement to a TextElement, do something like this …

    1. Convert TagElement.Value to a String
    2. Create a new TextElement, assigning the Variant from the tag (CStr (vtValue))
    3. Add the new TextElement to the active model
    4. If required, delete the TagElement

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • Hello,

    is there any reason why you cannot use the command:

    change tags droptext

    Best regards,

    Henk

Reply Children
No Data