1 Reply Latest reply on Feb 11, 2011 4:18 AM by taco.de.vries

    units mm or inch in scripts

    merlin

      Hallo,

       

      I've write a script for DxDesigner 2007.9. The script is drawing a table but the size of the table is not right. the table is to small and at the wrong point (see picture).

      can some one help?

       

      merlin


      Option Explicit

      ' Add any type librarys to be used.
      Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")
      Scripting.AddTypeLibrary("ViewDraw.Application")

      ' Get the Application object
      Dim wvAppObj
      Set wvAppObj = Application

      ' Get the active document
      Dim wvDocObj
      Set wvDocObj = wvAppObj.ActiveDocument

      ' Attach to a running DxDesigner process
      Dim vdapp
      Set vdapp = GetObject(,"ViewDraw.Application")
      vdapp.visible = True


      ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
      '
      ' Revhistorie
      '
      ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

      Dim StartpointX, StartpointY, EndpointX, EndpointY, MidpointX, MidpointY, DrawLine
      Dim SPointAx, SPointAy, EPointAx, EPointAy, MidAx, MidAy
      Dim SPointBx, SPointBy, EPointBx, EPointBy, MidBx, MidBy
      Dim SPointCx, SPointCy, EPointCx, EPointCy, MidCx, MidCy
      Dim SPointDx, SPointDy, EPointDx, EPointDy, MidDx, MidDy
      Dim SPointx, SPointy, EPointx, EPointy, Midx, Midy

      Dim avbApp
      Set avbApp = vdapp.ActiveView.Block

      avbApp.SheetSize = 17

      StartpointX = 280
      StartpointY = 166
      EndpointX = 410
      EndpointY = StartpointY
      MidpointX = (StartpointX + EndpointX)/2
      MidpointY = StartpointY

      Dim i
      For i = i to 20
          StartpointY = StartpointY + (6)
          Set DrawLine = avbApp.AddArc(StartpointX, StartpointY, MidpointX, StartpointY, EndpointX, StartpointY)
          SPointx = StartpointX
          SPointy = StartpointY - (6)
          EPointx = SPointx
          EPointy = StartpointY
          Midx = SPointx
          Midy = (SPointy + EPointy) / 2
          Set Drawline = avbApp.AddArc(SPointx, SPointy, Midx, Midy, EPointx, EPointy)
          SPointAx = StartpointX + (5)
          SPointAy = StartpointY - (6)
          EPointAx = SPointAx
          EPointAy = StartpointY
          MidAx = SPointAx
          MidAy = (SPointAy + EPointAy) / 2
          Set Drawline = avbApp.AddArc(SPointAx, SPointAy, MidAx, MidAy, EPointAx, EPointAy)
          SPointBx = StartpointX + (13)
          SPointBy = StartpointY - (6)
          EPointBx = SPointBx
          EPointBy = StartpointY
          MidBx = SPointBx
          MidBy = (SPointBy + EPointBy) / 2
          Set DrawLine = avbApp.AddArc(SPointBx, SPointBy, MidBx, MidBy, EPointBx, EPointBy)
          SPointCx = StartpointX + (28)
          SPointCy = StartpointY - (6)
          EPointCx = SPointCx
          EPointCy = StartpointY
          MidCx = SPointCx
          MidCy = (SPointCy + EPointCy) / 2
          Set DrawLine = avbApp.AddArc(SPointCx, SPointCy, MidCx, MidCy, EPointCx, EPointCy)
          SPointDx = StartpointX + (100)
          SPointDy = StartpointY - (6)
          EPointDx = SPointDx
          EPointDy = StartpointY
          MidDx = SPointDx
          MidDy = (SPointDy + EPointDy) / 2
          Set DrawLine = avbApp.AddArc(SPointDx, SPointDy, MidDx, MidDy, EPointDx, EPointDy)
      Next