Selection Set for XDATA objects

Discussion in 'AutoCAD' started by Nitin Patel, Feb 5, 2004.

  1. Nitin Patel

    Nitin Patel Guest

    Is it possible to convert following lisp statement to VBA?
    I would like to make a selection set of all the objects that have DATESTAMP
    application as an XDATA.

    If so how?

    (setq s1 (ssget "X" (list (list -3 (list "DATESTAMP")))))
     
    Nitin Patel, Feb 5, 2004
    #1
  2. Nitin Patel

    LochDhu Guest

    Here is a sample:
    Sub test()
    Dim intFilterType(0) As Integer
    Dim varFilterData(0) As Variant
    Dim objSelSet As AcadSelectionSet
    Dim varDat As Variant, varVal As Variant

    intFilterType(0) = 1001: varFilterData(0) = "DATESTAMP"
    varDat = intFilterType(0): varVal = varFilterData(0)
    Set objSelSet = ThisDrawing.SelectionSets.Add("rr")
    objSelSet.Select acSelectionSetAll, , , intFilterType, varFilterData
    MsgBox objSelSet.Count
    objSelSet.Delete

    End Sub

    Note the use of the extra variants, I can't remember why I had to do that -
    I guess it was a bug.

    Good Luck,

    Scott
     
    LochDhu, Feb 5, 2004
    #2
  3. Nitin Patel

    LochDhu Guest

    Disregard that...its been a long day...

    Sub test()
    Dim intFilterType(0) As Integer
    Dim varFilterData(0) As Variant
    Dim objSelSet As AcadSelectionSet

    intFilterType(0) = 1001: varFilterData(0) = "DCO15"
    Set objSelSet = ThisDrawing.SelectionSets.Add("rrr")
    objSelSet.Select acSelectionSetAll, , , intFilterType, varFilterData
    MsgBox objSelSet.Count
    objSelSet.Delete

    End Sub

    Scott
     
    LochDhu, Feb 6, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.