' This example, in Visual Basic 5, shows how an item's ' properties can be read and changed. The 'Add' command button ' adds a rectangle and extrudes it. ' The 'Double' button gets the extrusion height and doubles it ' The 'Blue' button makes the extrusion blue. Option Explicit ' the handle for the extruded item Private hItem As Long ' constants used to call MOZAIK Private Const PERS_VIEW = &H10000 Private Const PROP_COLOUR = 0 Private Sub cmdAdd_Click() ' add a rectangle hItem = Mzk.gRect(0#, 0#, 0#, 10#, 20#) hItem = Mzk.gExtrDepth(hItem, 5#) ' set up the view Mzk.gViewSetProjection PERS_VIEW Mzk.gViewSetAngles -45#, 20#, 0# ' view from bottom right corner Mzk.gViewFull 1 End Sub Private Sub cmdDouble_Click() Dim Props(2) As Variant Dim Height As Double Dim NumProps As Integer ' get the extrusion's properties NumProps = Mzk.gItemGetParams(hItem, Props(0), 2) ' double the height (Height is used to demonstrate ' casting between variant and double) Height = CDbl(Props(1)) * 2# Props(1) = Height ' reset the properties Mzk.gItemSetParams hItem, Props(0), 2 ' full view with redraw Mzk.gViewFull 1 End Sub Private Sub cmdBlue_Click() Dim col As Variant ' set a variant to an RGB colour col = RGB(0, 0, 255) ' change the item's colour Mzk.gItemSetProperty hItem, PROP_COLOUR, col ' redraw the view Mzk.gViewRepaint End Sub