+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Senior Member harrison-matt's Avatar
    Computer Details
    harrison-matt's Computer Details
    Operating System:
    Windows 7
    Computer:
    Acer Aspire TimelineX
    CPU:
    Intel i3
    RAM:
    4GB
    Monitor:
    Dual
    Using
    MEP 2012
    Join Date
    Jan 2010
    Location
    NOVA/DC
    Posts
    113

    Default Two questions that have not been asked often, maybe...

    Registered forum members do not see this ad.

    All,

    I am inquiring about how to add the ' apostrophe function to my programs.
    And how to have your ssget recognize objects selected prior to command start.

    Any thoughts?

    Kind Regards,

    Matt

  2. #2
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    Quote Originally Posted by harrison-matt View Post
    how to have your ssget recognize objects selected prior to command start.
    Code:
    (setvar 'Pickfirst 1)(ssget "_I" )
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  3. #3
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    Quote Originally Posted by harrison-matt View Post
    I am inquiring about how to add the ' apostrophe function to my programs.
    Can you explain more clearly about your aim?
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  4. #4
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    By apostrophe, I'm assuming you mean running the command transparently.
    If so, any LISP routine can be executed transparently IF and on IF it does NOT have any command calls.

    eg.
    Code:
    (defun c:L0 (/ ss i)
      (if (setq ss (ssget "_:L"))
        (repeat (setq i (sslength ss))
          (entmod (list '(8 . "0") (cons -1 (ssname ss (setq i (1- i))))))
        )
      )
      (princ)
    )
    If you notice, this can be executed transparently by typing 'L0 at any time AND if objects are selected before the routine is executed, it will process said objects, thus suppressing the prompt to select objects.
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,364

    Default

    ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used.

    As for the apostrophe, I'm unsure as to whether you are referring to marking expressions as literals or running a function transparently within a command. If it is the former, read this:
    http://www.cadtutor.net/forum/showpost.php?p=258390&postcount=20


    Lee
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  6. #6
    Senior Member harrison-matt's Avatar
    Computer Details
    harrison-matt's Computer Details
    Operating System:
    Windows 7
    Computer:
    Acer Aspire TimelineX
    CPU:
    Intel i3
    RAM:
    4GB
    Monitor:
    Dual
    Using
    MEP 2012
    Join Date
    Jan 2010
    Location
    NOVA/DC
    Posts
    113

    Default

    Quote Originally Posted by Lee Mac View Post
    ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used.
    I use ssget in the majority of my commands and if i have a selection set prior to launching the command it does not recognize the set.

    Matt

  7. #7
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,199

    Default

    Do you have a command call before the ssget call? Also, check our pickfirst variable.
    Last edited by alanjt; 30th Apr 2011 at 05:45 am.
    DropBox
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  8. #8
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    Quote Originally Posted by Lee Mac View Post
    ssget will detect an existing selection, regardless of whether the Implied "_I" mode string is used.]

    Lee
    You are right Lee, just to add some necessry explanations:
    1- If Pickfirst system variable is set to 1, (ssget) detects existing selection.
    2- If Pickfirst is set to 0, (ssget) prompts user to select desired objects.

    So what is the task of "_I"? I think NOTHING.
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,364

    Default

    Quote Originally Posted by Ahankhah View Post
    So what is the task of "_I"? I think NOTHING.
    Perhaps for when PICKFIRST is set to 0... I wouldn't know, I always have it set to 1.
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  10. #10
    Senior Member Ahankhah's Avatar
    Computer Details
    Ahankhah's Computer Details
    Operating System:
    Windows 8.2
    Using
    Revit 2015
    Join Date
    Jun 2010
    Location
    Tehran, Iran
    Posts
    472

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    Perhaps for when PICKFIRST is set to 0... I wouldn't know, I always have it set to 1.
    I tested that. It returnes a value and doesn't wait for user input or selection. This is the differnce of (ssget "_I") with (ssget).

    Pickfirst=0, a selection set exists: (ssget "_I") returns nil
    Pickfirst=1, no selection set exists: (ssget "_I") returns nil
    Pickfirst=1, a selection set exists: (ssget "_I") returns <Selection set: #>
    Pickfirst=1, no selection set exists: (ssget "_I") returns nil
    Mehrdad Ahankhah مهرداد آهن خواه
    www.IranCAD.com

Similar Threads

  1. I was asked to figure out a way...
    By AQucsaiJr in forum AutoCAD General
    Replies: 1
    Last Post: 18th Aug 2010, 01:35 pm
  2. I have asked this before - So sorry in advance...Open Menu Has Gone
    By primalscientist in forum AutoCAD General
    Replies: 2
    Last Post: 14th Aug 2010, 08:03 pm
  3. SHX files asked for by DWGs made from Microstation DGNs
    By chulse in forum AutoCAD General
    Replies: 6
    Last Post: 30th Jun 2008, 06:00 pm
  4. AutoCAD Graphics Hardware Frequently Asked Questions
    By Between the Lines in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 6th Sep 2007, 09:50 pm

Bookmarks

Posting Permissions

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