AnsweredAssumed Answered

How to access different Display schemes in Expedition?

Question asked by mixich on Oct 14, 2010
Latest reply on Nov 29, 2010 by hgk-layout

Hi all,

 

i want to select a display schemes over VBScript but an access on the returned array cause an error (Index Out of Range).

Using the function UBound() on the variable arrDispSchemas return the right number of the schemes. But i can't access a single string in the array.

What i'm doin wrong?

Here the code i wrote:

 

Dim appObj,textObj, docObj, dispCtrlObj
Dim arrDispSchemas

Dim placedCmpColl,arrLen

Set appObj = GetObject(,"MGCPCB.ExpeditionPCBApplication")
Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")

' collect document object
Set docObj = GetLicensedDoc(appObj)
If (Not docObj Is Nothing) Then

Set dispCtrlObj = docObj.activeView.DisplayControl

arrDispSchemas = docObj.DisplaySchemes(epcbLocalSchemes)
 
MsgBox "Liste:" &UBound(arrDispSchemas) ' The count of schemes is correct !!!!!!!!!!!!!!!!!!

MsgBox "Liste:" &arrDispSchemas(0) 'Error: Index Out of Range ????????????????????????

Set placedCmpColl = docObj.Components
'MsgBox("Cnt Comp:" &placedCmpColl.Count)
Dim cmpObj, txtXPos, txtYPos, str

For Each cmpObj In placedCmpColl 
  Set textObj  = PutFabricationLayerText  (cmpObj.AssemblyOriginX,cmpObj.AssemblyOriginY,cmpObj.Orientation,"Test",cmpObj.Side)
  Set textObj = Nothing
Next
End If

 

I will appreciate any help.

 

A. Mixich

Outcomes