hexagon logo

Strategy to pull point data from several features in a group

I want to write a script that will locate a group of constructed sets and write the point data from each out to an external file. I already have a robust solution in place to do this on a single feature where I pass over the ID of the feature as an argument and the script takes it from there. For this to work on a series of features I must call the script after each feature, which seems fairly tedious and clumsy. I would like to modify the script so that I can pass over the ID of a PC-DMIS group that contains all of the features I want to work with. The script will start at the first feature, write out all of the points, and then proceed to the next one in the group until it moves through every feature in the group. Has anyone ever done something similar to this and, if so, would you be willing to share your method for pointing the script to the group and working with the features contained in the group? I don't see much about groups in the language reference so I'm not sure how to proceed.

Thanks in advance.
Parents
  • I've never done this, but here is how I would skin this particular cat. Not tested, but shows the concept

    Dim pcd As Application
    Dim cmd As Command
    
    Set pcd = CreateObject("PCDLRN.Application", "")
    sPassedGroup = "GRP1"
    Set cmd = pcd.ActivePartProgram.Commands(sPassedGroup)
    
    If cmd Is Nothing Then
      MsgBox ("Invalid Group Name")
    ElseIf cmd.Type <> EW_GROUP_START Then
      MsgBox ("Passed name is not a group")
    Else
      cmd.Next
      While cmd.Type <> EW_GROUP_END
    
        'Process each set feature here
        '.
        '.
        '.
    
        cmd.Next
      Wend
    End If
Reply
  • I've never done this, but here is how I would skin this particular cat. Not tested, but shows the concept

    Dim pcd As Application
    Dim cmd As Command
    
    Set pcd = CreateObject("PCDLRN.Application", "")
    sPassedGroup = "GRP1"
    Set cmd = pcd.ActivePartProgram.Commands(sPassedGroup)
    
    If cmd Is Nothing Then
      MsgBox ("Invalid Group Name")
    ElseIf cmd.Type <> EW_GROUP_START Then
      MsgBox ("Passed name is not a group")
    Else
      cmd.Next
      While cmd.Type <> EW_GROUP_END
    
        'Process each set feature here
        '.
        '.
        '.
    
        cmd.Next
      Wend
    End If
Children
No Data