Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

[CE VBA] Text placement by origin not working as expected

$
0
0

Microstation Connect V10.16.02.34

I'm familiar with Excel VBA and taking a stab at writing VBA for the first time in Microstation to populate a chart/table.  (I know CE has a 'Place Table' tool but it doesn't have the functionality to do what I need)  My code works great for drawing the table but when I try to place the array of text strings from a text file at known coordinates, the text placement is not what I expect.  The text strings should be placed center/center justified at the center of each table 'box' based on the known coordinates.  I've set my text style to center/center justification and also tried coding 'ActiveSettings.TextStyle.Justification = msdTextJustificationCenterCenter' before placing the text and neither process work. 

I'm using the following code to place the text:

Set BodyText = CreateTextElement1(Nothing, DataArray(i, j), BTextPt, rotMatrix)
ActiveModelReference.AddElement BodyText

In the code above, the text string is DataArray(i, j) from my text file and the center of each box is the x-y coordinates of BTextPt.

Example of how the text is placed with both methods:

The properties of the text string show a center/center justification which I verified by drawing a red circle at its origin.

I found this thread from 2015 stating something similar but was unable to find a solution:  [Conncect vba] Problem with place text 

Am I doing something wrong?  Is there a bug/defect still in Microstation?  Can someone provide a solution to this problem?

Thanks in advance.


Viewing all articles
Browse latest Browse all 7260

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>