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?
Hi Erling,
I am not sure, but it can be caused by bug in MicroStation. Are you able to test the code in Update 14? Or share also test DGN, so anybody in this group will be able to run the code.
I remember e.g. in older versions tags were placed to Default level (not to active, if I remember correctly). It was fixed in some recent version, so when working with tags, it's always recommended to test it in the latest version.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
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