I am updating a VBA that runs fine in v8i to run in Connect.
The only part not working is adding text elements added by the vba to a graphic group. It does add new line elements, but text is not added to the GG.
In v8i at the end of the VBA run, all elements are in a GG, but in Connect they are not, only the lines are. If I run it in v8i and then open the file in Connect, the GG is recognized by Connect.
Code is something like this:
ActiveSettings.CurrentGraphicGroup = Application.UpdateGraphicGroupNumber..Add line and text elements by sending keyins using CadInputQueueActiveSettings.CurrentGraphicGroup = 0
I have tested to create Text using the function CreateTextElement1 with correct results, the graphicgroup number was correct assigned.If you are using recorded code to place text, this may differ between V8i and CONNECT Edition.Could you please provide a complete test case to allow us to reproduce the issue and the product with complete version number you are using - thank you.
Hello, I have Microstation CE 10.14 and I am encountering the same problem...
I need the user to enter a text via the place Icon tool and then assign the graphic group among other variable.
The graphic group is not assigned to the text element (however, this works in Microstation 8i)My code goes like this :
ActiveSettings.LineWeight = 12 ActiveSettings.LineStyle = ActiveDesignFile.LineStyles(1) CadInputQueue.SendCommand "active level 20" ActiveSettings.Color = 31 'ActiveSettings.TextStyle.Font = ActiveDesignFile.Fonts(51) CadInputQueue.SendKeyin "TEXTSTYLESET FONT ""fonte51.rsc"" ""Style (none)""" ActiveSettings.TextStyle.Height = 30 ActiveSettings.TextStyle.Width = 60 ActiveSettings.CurrentGraphicGroup = 21301 CadInputQueiue.SendComimand "PLACE DIALOGTEXT ICON"
Thanks in advance for any help :-)
Thank you for your follow up.
I tried that code, but it still failed to assign the graphic number.Would you be so kind as to notify me when the bug is corrected in Microstation CE.10.14 ?
This defect will be fixed with one of the following CE Update versions.
Could you please show the code which still fails?I had tested this workaround in CE Update 14 and it worked fine for me.
Hi Artur, this the code I am using :
ActiveSettings.CurrentGraphicGroup = 21000
ActiveSettings.LineWeight = 0
ActiveSettings.LineStyle = ActiveDesignFile.LineStyles(1)
CadInputQueue.SendCommand "active level 27"
ActiveSettings.Color = 10
ActiveSettings.TextStyle.Height = 20
ActiveSettings.TextStyle.Width = 15
CadInputQueue.SendKeyin "TEXTSTYLESET FONT ""fonte51.rsc"" ""Style (none)"""
CadInputQueue.SendKeyin "TEXTSTYLESET SINGLELINEJUST LEFTBOTTOM ""Style (none)"""
CadInputQueue.SendCommand "PLACE DIALOGTEXT ICON"
Dim ele As Element
Set ele = ActiveModelReference.GetLastValidGraphicalElement
ele.GraphicGroup = ActiveSettings.CurrentGraphicGroup
the keyin "PLACE DIALOGTEXT ICON" is waiting for input while the VBA code already has executed.Also DIALOGTEXT allows to place several text elements, which means this method to place text cannot be used in combination with the workaround.There are other methods which could be used instead, e.g.:- keyin "place text"- VBA method CreateTextElement1- VBA IPrimitiveCommandEventsIt depends on your needs which method you prefer.