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

RE: [V8i - VBA ] Dimension with several segments

$
0
0

Hi,

[quote user="rsousa"]How can I acess to each dimension indiviadually thru VBA[/quote]

Dimension element properties implement access through index (they can be treated as arrays). If no index (segment number) is defined, value 1 is used by default.

[quote user="rsousa"]I can only get and change the first segment.[/quote]

This code demonstrates how to access dimension values in one dimension element with ElementID = 512:

Option Explicit

Public Sub AccessDimension()

    Dim dimension As DimensionElement
    Set dimension = ActiveModelReference.GetElementByID(DLongFromLong(512))

    Dim numOfDims As Integer
    numOfDims = dimension.ReferencePointsCount - 1

    Dim dimIndex As Integer

    For dimIndex = 1 To numOfDims
        MsgBox "Value: " + CStr(dimension.ActualValue(dimIndex))
    Next

End Sub

With regards,

  Jan


Viewing all articles
Browse latest Browse all 7260

Trending Articles



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