DxDesigner - Automation method to get or set metric based Property Size

Document created by timo_kyyronen on Apr 11, 2014Last modified by timo_kyyronen on Apr 14, 2014
Version 3Show Document
  • View in full screen mode

Supported in EE7.9.5_Update16 and EE7.9.4_Update27 or later

In DxDesigner automation it has been possible to get only integer ("long") value representing 100ths of inch for size property of attribute object

By using the following example it's now possible to get also an exact mm value via automation.



There is a object called HighPrecisionObject supporting VDUNIT_MM, VDUNIT_CM and VDUNIT_INCH.

Below is an example how to use this object.

Dim vdapp
Set vdapp = GetObject (,"ViewDraw.Application")


Dim vddoc,vdview


Set vddoc = vdapp.ActiveDocument
Set vdview = vdapp.ActiveView


Dim hiPrecObj
set hiPrecObj = CreateObject ("Viewdraw.HighPrecisionObject")


Dim oComp, oCompAttr
Dim  tkySize, tkyProp, tkyActSize
For Each  oComp in vdview.Query(VDM_Comp, VD_SELECTED)
  For Each oCompAttr in  oComp.Attributes
    Set  tkyProp = oComp.FindAttribute("Ref Designator")
    If Not tkyProp Is Nothing Then

     hiPrecObj.SetObject (tkyProp)
     tkySize = hiPrecObj.GetSize(VDUNIT_MM)  
     MsgBox  tkySize & "  Is the  text Size "

        hiPrecObj.SetSize VDUNIT_MM, 5 'Set text size 5 mm

    End If


'Also coordinates are supported. Below is an example syntax for "X". "Y" can be used as well.


'hiPrecObj.SetX VDUNIT_MM, 10