Product : Engine, Version : 5.0.0.1033, ArticleID : 41023635

HowTo : Model space ,Layout and Viewport BkColorEx usage

Article41023635
TypeHowTo
ProductEngine
Version5.0.0.1033
Date Added7/13/2004
Submitted byWayne Romer
Keywords

Subject

Model space ,Layout and Viewport BkColorEx usage

Summary

Model space ,Layout and Viewport BkColorEx usage

Solution

You should use a code like this :

Private Sub cmdLoad_Click()
    Dim vLay As vdLayout

    Set vLay = VDPro.ActiveDocument.LayOuts.Add("TEMP")
    vLay.BkColorEx.RGB = 16777215
    Set VDPro.ActiveDocument.ActiveLayOut = vLay

    VDPro.Redraw
End Sub

Private Sub Command1_Click()
    Set VDPro.ActiveDocument.ActiveLayOut = Nothing
    VDPro.ActiveDocument.Entities.AddText "Model space is now white and
there is nothing you can do!!!", Array(0, 0, 0), 1
    VDPro.CommandAction.Zoom "E", 0, 0
End Sub

Private Sub Form_Load()
    VDPro.ActiveDocument.New
    VDPro.ActiveDocument.Model.BkColorEx.RGB = 0 'to black
End Sub
Note: It is better (ONLY FOR BACKGROUND COLOR) to use RGB values and not the ColorIndex.