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

RE: VBA: pattern informations

$
0
0

Hi Jacqueline,

[quote user="Mini"]How do I get pattern informations of a pattern placed with "associative pattern" and "associative region boundary" with VBA?[/quote]

There are no such methods / properties in MicroStation VBA available, but you can use PropertyHandler to access parameters availables in Element Information dialog.

If Associative Region Boundary switch is on, a result of patterning is Associative Region, which is impemented as a cell element. So the whole process is to find a proper cell, create property handler and to access values using their Access Strings.

Simple example:

Option Explicit

Public Sub GetPatternParams()

    Dim regionBoundary As CellElement
    Set regionBoundary = ActiveModelReference.GetElementByID(DLongFromLong(10892))
    
    Dim ph As PropertyHandler
    Set ph = CreatePropertyHandler(regionBoundary)
    
    ph.SelectByAccessString ("HatchAngle")
    Dim patternAngle As Double
    patternAngle = ph.GetValue * 180 / Pi
    
    MsgBox "Pattern angle: " & patternAngle

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>