Results 1 to 10 of 10

Thread: A workaround to using sssetfirst...

  1. #1
    I could stop if I wanted to
    Join Date
    2009-04
    Location
    Houston, TX
    Posts
    204
    Login to Give a bone
    0

    Default A workaround to using sssetfirst...

    I am on LT w/ TKMAX addition which is not accepting the following (it errors and AutoCAD has to be restarted..

    Code:
    (sssetfirst nil ss)
    I also tried the following but still it failed

    Code:
    (apply 'sssetfirst (list nil ss))
    Is there another way to getting your object selected w/out user input??

  2. #2
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    ActiveX maybe ... sorry, unfamiliar with TKMax, not sure if the vla/vlax functions are supported.

  3. #3
    I could stop if I wanted to
    Join Date
    2009-04
    Location
    Houston, TX
    Posts
    204
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Some of it is, some of it isn't, and some of it has to be written differently from full AutoCAD, and there is no support that I've found showing how to write it which makes things interesting..

    I will look into vla/vlax and keep my fingers crossed! Thanks

  4. #4
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    From the top of my head ... you should be able to obtain an ActiveX reference using vlax-ename->vla-object. Then each vla object has a Highlight method (that is each object linked to an actual entity). So the code should look something like this (assume en is the ename of the entity as you get from ssname):
    Code:
    (setq eo (vlax-ename->vla-object en)) ;Get the ActiveX Object
    (vla-Highlight eo :vlax-true) ;Set highlight to true
    The last line may be something different such as:
    Code:
    (vlax-Invoke eo 'Highlight :vlax-true)
    Or possibly:
    Code:
    (vlax-Invoke-Method eo 'Highlight :vlax-true)

  5. #5
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Sorry, for the undocumented (even in full ACad) vlax-Invoke you should use:
    Code:
    (vlax-Invoke eo 'Highlight 1)
    And to turn it off
    Code:
    (vlax-Invoke eo 'Highlight 0)
    For the other 2 you can use :vlax-false to turn highlight off again.

  6. #6
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Quote Originally Posted by irneb View Post
    Sorry, for the undocumented (even in full ACad) vlax-Invoke you should use:
    Code:
    (vlax-Invoke eo 'Highlight 1)
    And to turn it off
    Code:
    (vlax-Invoke eo 'Highlight 0)
    For the other 2 you can use :vlax-false to turn highlight off again.
    That's all well and good, aside from trying to use the ActiveX COM in LT, except that highlighting objects is not the same as selecting objects. So this isn't really helping the OP preselect the objects.

    The OP might try: (command "._PSelect" "_single" ss)
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  7. #7
    I could stop if I wanted to
    Join Date
    2009-04
    Location
    Houston, TX
    Posts
    204
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    I haven't had a chance to try any of the suggestions yet, but off topic real fast.. What's the difference between highlight and select?

    I have never run into a situation where I needed to merely highlight something. I can't even say I know how to do it, if it is possible to highlight or if it's a lisp only action. When would highlighting be useful?

  8. #8
    The Silent Type RobertB's Avatar
    Join Date
    2000-01
    Location
    Seattle WA USA
    Posts
    5,859
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Quote Originally Posted by M. Kubitza View Post
    I haven't had a chance to try any of the suggestions yet, but off topic real fast.. What's the difference between highlight and select?

    I have never run into a situation where I needed to merely highlight something. I can't even say I know how to do it, if it is possible to highlight or if it's a lisp only action. When would highlighting be useful?
    Highlight shows objects dashed as if they were selected. It can be useful when you want to draw the user's attention to an object on the screen yet a selection of the object is not required or you already have multiple objects in a selection set.

    For example, a text editing routine that allows you to add a prefix/suffix to a selection set of text, but you iterate thru the selected objects giving the user the chance to accept adding to the highlighted text object.

    Highlighting an object, rather than selecting it, can only be done via the APIs AFAIK.
    R. Robert Bell
    Design Technology Manager
    Stantec
    Opinions expressed are mine alone and do not reflect the views of Stantec.

  9. #9
    I could stop if I wanted to
    Join Date
    2009-04
    Location
    Houston, TX
    Posts
    204
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Quote Originally Posted by RobertB View Post
    Highlight shows objects dashed as if they were selected. It can be useful when you want to draw the user's attention to an object on the screen yet a selection of the object is not required or you already have multiple objects in a selection set.

    For example, a text editing routine that allows you to add a prefix/suffix to a selection set of text, but you iterate thru the selected objects giving the user the chance to accept adding to the highlighted text object.

    Highlighting an object, rather than selecting it, can only be done via the APIs AFAIK.
    This is what I thought highlight was used for, but thought there may be something else I could put to use in my routines. No surprise for highlighting, I figured it was a lisp only action.

    Also, thank you for your alternative to my code, it works perfectly!

  10. #10
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: A workaround to using sssetfirst...

    Quote Originally Posted by RobertB View Post
    That's all well and good, aside from trying to use the ActiveX COM in LT, except that highlighting objects is not the same as selecting objects. So this isn't really helping the OP preselect the objects.

    The OP might try: (command "._PSelect" "_single" ss)
    Yep! I may have understood incorrectly, re-reading the OP it did mention select instead of highlight - my bad. If you want the objects to form part of the previous selection set (i.e. the user can use P to select whatever your code's selected automatically) then Robert's method should work. In full acad the sssetfirst should perform a similar "trick", but as shown it doesn't work for LT.

Similar Threads

  1. Spline workaround tip
    By AP23 in forum Revit Architecture - Tips & Tricks
    Replies: 13
    Last Post: 2011-08-09, 11:26 PM
  2. 3-D Iso callouts - workaround?
    By bjlottis in forum Revit - Platform
    Replies: 5
    Last Post: 2009-02-12, 11:36 PM
  3. LISP workaround
    By esdeyo in forum AutoCAD LT - General
    Replies: 5
    Last Post: 2007-08-20, 01:53 PM
  4. Footing Workaround
    By Matt Brennan in forum Revit Architecture - Tips & Tricks
    Replies: 0
    Last Post: 2006-01-23, 10:37 PM
  5. Structural Beams Workaround
    By zenomail105021 in forum Revit Architecture - Tips & Tricks
    Replies: 2
    Last Post: 2005-08-22, 12:14 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
  •