Generating selection sets for another drawing using VLisp

Discussion in 'AutoCAD' started by Fraser Atkinson, Mar 24, 2005.

  1. Can anybody help with this:

    (setq SSet (vlax-invoke-method (vlax-get-property PanelDoc 'SelectionSets)
    'Add 0)
    LLWP (vlax-3D-Point (list (- 10000) (- 10000) 0))
    URWP (vlax-3D-Point (list 100000 100000 0))
    );setq
    (vlax-invoke-method sset 'select acSelectionSetWindow LLWP URWP 8
    (vlax-make-variant "0"))

    ACAD developer help says the FilterType should be an integer, but this gives
    me an error:
    "error: Automation Error. Invalid argument FilterType in Select"

    Any ideas are MUCH appreciated.
     
    Fraser Atkinson, Mar 24, 2005
    #1
  2. Fraser Atkinson

    Jeff Mishler Guest

    You must put the Dxf Code and Value into safearrays.....here's your code
    modified, based on that it looked like you wanted to get everything on layer
    0.....

    (setq SSet (vlax-invoke-method (vlax-get-property PanelDoc 'SelectionSets)
    'Add "Layer0"))
    (setq LLWP (vlax-3D-Point (list (- 10000) (- 10000) 0))
    URWP (vlax-3D-Point (list 100000 100000 0))
    iCode (vlax-safearray-fill
    (vlax-make-safearray
    vlax-vbinteger '(0 . 0)) '(8))
    val (vlax-safearray-fill
    (vlax-make-safearray
    vlax-vbvariant '(0 . 0)) '("0"))
    );setq

    (vlax-invoke-method sset 'select acSelectionSetWindow LLWP URWP icode val)
    (vla-get-count sset)
     
    Jeff Mishler, Mar 24, 2005
    #2
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.