Results 1 to 10 of 12

Thread: Pass vba selection set to lisp or command line?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    100 Club KevinBarnett's Avatar
    Join Date
    2001-10
    Location
    Pretoria, South Africa
    Posts
    119
    Login to Give a bone
    0

    Question Pass vba selection set to lisp or command line?

    Hi Gang,

    Does anybody know how to pass a named VBA selection set to lisp or the command line?

    For example. There appears to be no VBA method equal to the BOUNDARY command. You would need this to specify a selection to represent a specific boundary set whilst executing the boundary command.

    At the moment I am using this:

    SelStBnd.Clear
    SelStBnd.Select acSelectionSetAll, , , FilterType, FilterData
    ThisDrawing.SendCommand _
    "(setq ss (ssget " & Chr(34) & "x" & Chr(34) & " (list (cons 8 " & _
    Chr(34) & FilterData(0) & Chr(34) & " ))))" & vbCr

    where SelStBnd is named selection set and FilterData(0) is layer names

    After using this ss is available for re-use at the command prompt as a selection set. But surely there is a "vla" subr to transfer the VBA selection set to a lisp/command prompt selection set, which would be quicker than selecting twice.

    Thanks,

    Kevin.
    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,656
    Login to Give a bone
    0

    Default Re: Pass vba selection set to lisp or command line?

    I wrote a function to do that but, I'm not at work, so I can't give you the code directly. Here is a link to an adesk ng thread where I've posted it before.
    C:> ED WORKING....

  3. #3
    100 Club KevinBarnett's Avatar
    Join Date
    2001-10
    Location
    Pretoria, South Africa
    Posts
    119
    Login to Give a bone
    0

    Red face Re: Pass vba selection set to lisp or command line?

    Thanks Ed, but ... I'm still not clear.

    The link jumped to http://discussion.autodesk.com/threa...sageID=2140242 which resolves sendcommand reference to a single entity by using its handle.

    I'm looking at referring to a selection set (previously named and populated in VBA) with sendcommand. Or did I miss something? Thanks for your patience.

    Cheers,

    Kevin.
    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

  4. #4
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,656
    Login to Give a bone
    0

    Default Re: Pass vba selection set to lisp or command line?

    You pass the entity to the function. A selection set is an object. Both have handles and will work with the (handent) function. You just need to modify the signature of the function to accept objects instead of entities. I would create a new function from this one.
    C:> ED WORKING....

  5. #5
    100 Club KevinBarnett's Avatar
    Join Date
    2001-10
    Location
    Pretoria, South Africa
    Posts
    119
    Login to Give a bone
    0

    Cool Re: Pass vba selection set to lisp or command line?

    How do you get the handle of the selection set in VBA?

    I tried this:

    Sub try()
    Dim ss As AcadSelectionSet
    Dim ao As AcadObject
    Set ss = ThisDrawing.SelectionSets.Add("Temp1")
    ss.Clear
    ss.SelectOnScreen

    MsgBox ss.Handle '''' This causes error 438, object doesnt support this property or method

    Set ao = ss ''' This causes error: Type mismatch
    MsgBox ao.Handle
    End Sub

    Isnt there a "vla" that can get the activex named selection set and place it in a command/lisp type selection set - maybe something like (vla-get *selectionsets* "name")?

    I'm really hoping you wont get frustrated with my simple questions. Thanks for your help.

    Kevin.
    Acad 2007, Autodesk Map 3D 2007, 3D, VBA, Lisp, C#.Net, Windows XP Pro (been using AutoCAD since 1989)

  6. #6
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,656
    Login to Give a bone
    0

    Default Re: Pass vba selection set to lisp or command line?

    No, that's ok. I'm just out of town now and can't really help too much. If no one else can help, I hope you can wait till Monday when I get back.
    C:> ED WORKING....

  7. #7
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    5,656
    Login to Give a bone
    0

    Default Re: Pass vba selection set to lisp or command line?

    Quote Originally Posted by Ed Jobe View Post
    I wrote a function to do that but, I'm not at work, so I can't give you the code directly. Here is a link to an adesk ng thread where I've posted it before.
    Updated link is https://forums.autodesk.com/t5/visua...ems/m-p/300072
    C:> ED WORKING....

Similar Threads

  1. Multiple Selection Sets To One Line Lisp
    By mbrandt5 in forum AutoLISP
    Replies: 5
    Last Post: 2015-07-16, 02:22 PM
  2. Replies: 3
    Last Post: 2009-10-22, 10:19 PM
  3. How do I pass a selection on to LISP?
    By dfuehrer in forum AutoLISP
    Replies: 3
    Last Post: 2007-09-18, 04:53 PM
  4. Pass a selection set to a program
    By ccowgill in forum AutoLISP
    Replies: 4
    Last Post: 2007-05-18, 01:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •