attach tag

attach tag

Post by Li Siu Pa » Wed, 30 Jun 1999 04:00:00



Does anyone know what's wrong with the following procedure? I want to
attach a tag to the element selected.  Although this procedure can
successfully complete, the tag is not attached. From
MbeElement.isTagged, I am sure a tag is added, but the value of
MbeElement.numTags is still 0.

Thanks a lot!!

Thomas Li

--------------------------------------

Sub main

dim dataPoint as MbePoint
dim element as new MbeElement
dim tag as new MbeTag

tag.setName = "tagSet"
tag.name = "tagName"
tag.value = "testing"

MbeGetInput MBE_DataPointInput

if MbeState.getInputDataPoint(dataPoint) = MBE_Success then

   MbeStartLocate 0, 1, 0, FALSE
   MbeSendDataPoint dataPoint

   if MbeState.cmdResult = MBE_AcceptQuery then

      filePos = element.fromLocate()

      if filePos >= 0 then

         if element.attachTag(tag) = MBE_Success then
            element.rewrite()
                                                ' Output value
            MbeMessageBox(str$(tag.id))         ' 0
            MbeMessageBox(str$(tag.targetId))   ' 69
            MbeMessageBox(str$(element.isTagged)) ' 1 -- is tagged
            MbeMessageBox(str$(element.numTags))' 0

         end if
      end if
   end if
end if
end sub

 
 
 

1. Macro using attach tag

When I run the following macro it works as expected. When I close this
dgn file and open a new dgn file without exiting MicroStation and run
the macro again it waits for the user to input a tag value for fuseno.
When I exit MicroStation completely and enter MicroStation again the
macro works as expected.
Please HELP!

Macro:
Sub main
    Dim startPoint As MbePoint
    Dim point As MbePoint, point2 As MbePoint

'   Start a command
    MbeSendCommand "PLACE CIRCLE ICON "

'   Coordinates are in master units
    startPoint.x = 2038.750000#
    startPoint.y = -3704766.310000#
    startPoint.z = 0.000000#

'   Send a data point to the current command
    point.x = startPoint.x
    point.y = startPoint.y
    point.z = startPoint.z
    MbeSendDataPoint point, 1%

    point.x = startPoint.x + 55.240000#
    point.y = startPoint.y - 46.710000#
    point.z = startPoint.z
    MbeSendDataPoint point, 1%

    MbeSendCommand "Attach Tags "

'   Send a keyin that can be a command string

    MbeSendKeyin "TAGJOURNAL ATTACH SET fuseno"

    point.x = startPoint.x + 63.740000#
    point.y = startPoint.y - 33.970000#
    point.z = startPoint.z
    MbeSendDataPoint point, 1%

    point.x = startPoint.x + 293.200000#
    point.y = startPoint.y
    point.z = startPoint.z
    MbeSendDataPoint point, 1%

    MbeSendKeyin "TAGJOURNAL ATTACH TAG fuseno"

'   When a command brings up a modal dialog,
'   a later statement must close the dialog,
'   or the MbeState.modalDialogByUser property
'   should be set to 1 so that the user must close
'   the dialog when the macro is executed.
'   Also, you may not use the debugger "Step"
'   commands while a modal dialog is displayed.

'   Opened modal dialog "Attach Tags [fuseno]"

    MbeSendKeyin "TAGJOURNAL ATTACH VALUE 1234"

    MbeSendKeyin "TAGJOURNAL ATTACH VALUE 1234"

'   Closed modal dialog "Attach Tags [fuseno]"

'   Following comment is the command to close a modal dialog
   MbeSendCommand "MBE1 CLOSEMODAL OK"

    point.x = startPoint.x + 118.980000#
    point.y = startPoint.y
    point.z = startPoint.z
    MbeSendDataPoint point, 1%
End Sub

2. patches

3. Attaching tags to elements

4. Printing Problem In Ami-pro W/ Solution

5. Attaching tags

6. Full text search of XML data

7. Attaching tags to selection set

8. pppd problem !!

9. Attaching Tags to Cell's

10. Attaching tags to complex element

11. Attaching tag libraries..

12. attach tag