[CONNECT Update 12 VBA], [V8i SELECTseries 3 VBA] VBA place Tag text on active level works in V8i but not in CONNECT

I have an old VBA program placing symbols with Tag data on different levels - it is running fine on V8i but not in CONNECT.

I want to place symbol on active level and place the Tag text on another level ("Tag_Kote")  - here is a small snippet from the code:

    point.X = 723253.923
    point.Y = 6217533.633
    point.Z = 26.42
    tekst = "C"
    Set oEt = CreateTextElement1(Nothing, tekst, point, Matrix3dIdentity)

    CadInputQueue.SendKeyin "ft=Times New Roman"
    CadInputQueue.SendKeyin "ACTIVE TXJ LB"
    CadInputQueue.SendKeyin "tx=" + Str$(tagTxtSize)
    CadInputQueue.SendKeyin "co=0"
    ActiveSettings.Level = ActiveLV

    ActiveModelReference.AddElement oEt
    oEt.Color = 3
    oEt.Rewrite
'*********************************************************
    Set ts = GetTagSet(nWords, asArguments)
    today = Date
    distanceX = 0.5
    distanceY = 0#
    Set tagDefs = ts.TagDefinitions

    Set LvTag = ActiveDesignFile.Levels("Tag_Kote")
    ActiveSettings.Level = LvTag

    tekst =  "Kote"
    Set tagdef = tagDefs(tekst)
    Set eleTag = oEt.addTag(tagdef)
    pntSavedOffset = eleTag.Offset
    eleTag.Move Point3dFromXY(distanceX, distanceY)
    distanceY = distanceY + 2 * ActiveSettings.TextStyle.Height
    tekst = "Placering over ledning"
    eleTag.Value = tekst
    eleTag.Redraw
    eleTag.Rewrite

    ActiveSettings.Level = ActiveLV

Symbols and Tag Text are placed on the same lavel in CONNECT. Why don't it work in Connect?

Parents Reply
  • Hi,

    after a first test this seems to be a regression from V8i, the new tag level is inherited from the base element the tag is attached to.
    I will file a Defect to address this issue.

    As workaround it seems to work if the desired level is directly assigned to the tag element like this:

    eletag.value = tekst
    Set eletag.Level = ActiveDesignFile.levels("Tag_Kote")
    eletag.Rewrite
    

    Thanks for reporting this issue.

    UPDATE: Defect 1109158 filed to address this issue

    Best regards,
    Artur

Children
No Data