Excel to Microstation Connect - VBA - Lesson 2 - Adding Texts - Beginners level

preview_player
Показать описание
This code shows how to Place texts from Microsoft Excel to Microstation using VBA coding. it is based on a static number of rows in one column.
this is beginners level

see part of the code below

Sub Addtext()

Dim myMSAppCon As MicroStationDGN.ApplicationObjectConnector
Dim myMSApp As MicroStationDGN.Application
Dim myLine As LineElement
Dim LineSt As Point3d
Dim LineEn As Point3d
Dim mytext As TextElement
Dim RotMatrix As Matrix3d
Dim c As Range

lr = Worksheets("Sheet1").Cells(Rows.Count, 1).End(xlUp).Row

txtgp = lr * 0.05


Set myMSAppCon = GetObject(, "MicroStationDGN.ApplicationObjectConnector")
Set myMSApp = myMSAppCon.Application

Set mytext = myMSAppCon.Application.CreateTextElement1(Nothing, Worksheets("Sheet1").Range("A1"), Point3dFromXYZ(0, txtgp * 6, 0), RotMatrix)
myMSApp.ActiveModelReference.AddElement mytext

End Sub

Free Music from
Music: Glare On The Water by Vlad Gluschenko is licensed under a Creative Commons License.
Рекомендации по теме
Комментарии
Автор

could you teach me how to use vba to create smart line in MicroStation? Thanks!!

RonnyCheung-qh
Автор

Can you make a video on how create dimension with the preset DIM Settings for a foundation as shown in the Lesson 1.

codekillmaster
Автор

Thanks Mr SM. Could you teach VBA for place a note with multiple line text please.

kkkk
join shbcf.ru