Quantcast
Channel: Manufacturing DevBlog
Viewing all articles
Browse latest Browse all 532

Add Workgroup search path at first position

$
0
0

By Adam Nagy

It seems that using the WorkgroupPaths.Add(Name, Path, Index) function there is no way to insert the new path at the first position in the list. If you pass in 0 as Index, then it's placed at the end, if you pass in 1, then it's placed at the second position.

The workaround is to remove the item at the first position and reinsert it at the second position (Index = 1):

Sub AddWorkGroupSearchPathAtFirstPosition()
  Dim dpm As DesignProjectManager
  Set dpm = ThisApplication.DesignProjectManager

  Dim dp As DesignProject
  Set dp = dpm.ActiveDesignProject
  
  ' Add the new path: this will place it at' second position
  Call dp.WorkgroupPaths.Add("CommonspaceNew", "C:\Temp", 1)' Workaround: remove the one currently at the 1st position' and then add it back as second
  Dim pp1 As ProjectPath
  Set pp1 = dp.WorkgroupPaths(1)
  Dim name As String
  Dim path As String
  name = pp1.name
  path = pp1.path
  Call pp1.Delete
  Call dp.WorkgroupPaths.Add(name, path, 1)
End Sub

WorkgroupSearchPaths

 


Viewing all articles
Browse latest Browse all 532

Trending Articles