You are currently reviewing an older revision of this page.
Background Information
When importing coordinates, they can often be represented by dots. The disadvantage to this is that they can be hard to see in the drawing because they are so small.
Therefore, it would be desireable to have an alternate representation of points in a drawing.
Steps
I will show a small routine here that replaces all of the points with circles. The size of the circle is defined in the program and can easily be adapted to your own needs. The points are displayed in MicroStation by lines of longitude 0. Therefore, the routine will search through the drawing to find all lines of length 0 and replace them with circles.
Here is the example:
Sub
line2circle()
Dim
Ee
As
ElementEnumerator
Sc
New
ElementScanCriteria
Anzahl
Long
' Counter for the deleted items
oCirc
EllipseElement
' Ellipse (A circle is a special case of an ellipse) to exchange the points:
oElli
Ellipse3d
oElli.Vector0 = Point3dFromXYZ(0, 0.5, 0)
oElli.Vector90 = Point3dFromXYZ(0.5, 0, 0)
oElli.Start = 0
oElli.Sweep = 2 * Pi
' If the line length is 0 it will be changed:
Sc.ExcludeAllTypes
Sc.IncludeType msdElementTypeLine
Set
Ee = ActiveModelReference.Scan(Sc)
Do
While
Ee.MoveNext
If
Ee.Current.AsLineElement.Length = 0
Then
oElli.Center = Ee.Current.AsLineElement.startPoint
oCirc = CreateEllipticalElement1(
Nothing
, oElli, msdFillModeNotFilled)
ActiveModelReference.AddElement oCirc
ActiveModelReference.RemoveElement Ee.Current
End
Loop
MessageCenter.AddMessage
"There were "
+ str(Anzahl) +
" lines replaced by circles."
, , msdMessageCenterPriorityInfo
After the points are changed, the number of points that were replaced will be output in a short message in the message center.
See Also
Deleting Lines of Length 0 Using VBA