60002004 Get Set properties or call methods of objects that are not implement in ActiveX warapper component

Article 60002004
Type Wish
Product Engine
Version 6025
Date Added 7/12/2013 12:00:00 AM
Fixed (7/12/2013 12:00:00 AM)
Submitted by Frank Louis

Summary

Get Set properties or call methods of objects that are not implement in ActiveX warapper component (vdraw.ocx)

Solution

In version 6026 a new method InvokeEx was added to vdraw.ActiveDocument object

resvalue = InvokeEx(obj , methodname, methodtype, parameters)
obj : Object to get/set a property or invoke method
methodname : Property or method name
methodtype : 0 to invoke a method, 1 to set a property value or 2 to get a property value
parameters : Set it to a property value when set a property(methodtype = 1) or an array of parameters define the method parameter values when invoke a method(methodtype = 0)
resvalue : A property value when get a property , Method return value when invoke a method, false if not success

Example in VB (Get / Set the property AlignToViewSize for a vdText object)
VDraw1.CommandAction.CmdText "123", Array(0, 0), 0
VDraw1.CommandAction.Zoom "e", 0, 0
resval = VDraw1.ActiveDocument.InvokeEx(VDraw1.ActiveDocument.Entities.Last, "AlignToViewSize", 1, 20) ''set property AlignToViewSize for a vdText object to 20
resval = VDraw1.ActiveDocument.InvokeEx(VDraw1.ActiveDocument.Entities.Last, "AlignToViewSize", 2, Nothing) ''get property AlignToViewSize of a vdText

Send comments on this topic.