Prod.: Engine, ver.: 6, ID: 60000722, HowTo : How can I use the AlignToView and AlignToViewSize in the wrapper

HowTo : How can I use the AlignToView and AlignToViewSize in the wrapper

Article60000722
TypeHowTo
ProductEngine
Version6
Date Added12/29/2008
Submitted byJesus Nicolas Zaragoza Grife
Keywords

Subject

How can I use the AlignToView and AlignToViewSize in the wrapper

Summary

How can I use the AlignToView and AlignToViewSize in the wrapper

Solution

This article applies to version 6014 and above. Using the VectorDraw.Professional.tlb,  on a VB6 project just add a vdraw wrapper and 2 buttons and a code like :
Private Sub Command6_Click()
Dim txt As VDrawI5.vdText
Dim AlignObject As VectorDraw_Professional.IAlignToView
 
    Set txt = VD.ActiveDocument.entities.AddText("aaBB", Array(10, 10), 1)
    VD.CommandAction.CmdRect Array(9.5, 9.5), Array(14, 11.5)
    VD.CommandAction.Zoom "E", 0, 0
   
    Set AlignObject = txt.WrapperObject ' set this text to be always parallel to the view.
    AlignObject.AlignToView = True
    AlignObject.AlignToViewSize = 20 'text size always the same, size in pixels
End Sub
 
Private Sub Command7_Click()
    VD.CommandAction.View3D "VROT"
End Sub