Did 2005 change (Command "xxx" ... syntax?

Discussion in 'AutoCAD' started by MP, Jun 7, 2004.

  1. MP

    MP Guest

    Hi
    We just upgraded to 2005 and now all my quick and dirty lisp functions that
    used (command "somecommand" selset xxx)
    no longer function
    instead of using the selection set passed in as argument the select objects
    prompt keeps reappearing and errors out.

    Is it no longer possible to cheat by using the slimy command method?

    example

    (defun moveset (inputSet dirToMove distToMove)
    (command "move" inputSet "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    (princ)
    );end defun c:md ()

    this worked in 2002 but not in 2005
    the "" no longer closes the select object prompt
    (command "move" inputSet ""

    is there a standard revision I need to make to all routines such as this
    or do i need to finally learn the trans and translate coordinates stuff? and
    get rid of all these lazy "command" routines?
     
    MP, Jun 7, 2004
    #1
  2. Works for me. What is the error you get?

    --
    R. Robert Bell


    Hi
    We just upgraded to 2005 and now all my quick and dirty lisp functions that
    used (command "somecommand" selset xxx)
    no longer function
    instead of using the selection set passed in as argument the select objects
    prompt keeps reappearing and errors out.

    Is it no longer possible to cheat by using the slimy command method?

    example

    (defun moveset (inputSet dirToMove distToMove)
    (command "move" inputSet "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    (princ)
    );end defun c:md ()

    this worked in 2002 but not in 2005
    the "" no longer closes the select object prompt
    (command "move" inputSet ""

    is there a standard revision I need to make to all routines such as this
    or do i need to finally learn the trans and translate coordinates stuff? and
    get rid of all these lazy "command" routines?
     
    R. Robert Bell, Jun 7, 2004
    #2
  3. MP

    ECCAD Guest

    Are you using Osnap settings - or are they left at 0 ?
    Bob
     
    ECCAD, Jun 7, 2004
    #3
  4. MP

    MP Guest

    example:
    ;simplified test command
    (defun c:mdTEST ()
    (movedown (getset "\nSet to move down: ") 1)
    (princ)
    );end defun c:md ()

    ;;;*down* is a global = (* pi 1.5)
    (defun movedown (inputSet inputDist )
    (if inputSet
    (moveset inputSet *down* inputDist)
    )
    )

    (defun moveset (inputSet dirToMove distToMove)
    (command "move" inputSet "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    (princ)
    );end defun c:md ()

    (defun GetSet ( prmpt / selset)
    (or(setq selset (ssget "I"))
    (progn
    (if prmpt(prompt prmpt))
    (setq selset (ssget))
    );prong
    )
    selset
    )

    result at textscreen:
    Command: MDTEST
    move
    Select objects: 1 found

    Select objects:
    Select objects: _NON 0 found
    Select objects: _NON Specify opposite corner: *Cancel*
    0 found


    I would much rather figure out how to use transformations but just don't
    have time at the moment to delve into it further than my current meager
    understanding to revise bunches of old quickie commands like the above.
     
    MP, Jun 7, 2004
    #4
  5. MP

    MP Guest

    I usually run osnaps, that's why the "_non" modifiers
     
    MP, Jun 7, 2004
    #5
  6. Still no trouble. I'll bet it is a pick var on your end. These are mine:

    PICKADD 0
    PICKAUTO 1
    PICKBOX 3
    PICKDRAG 0
    PICKFIRST 0
    PICKSTYLE 1


    --
    R. Robert Bell


    example:
    ;simplified test command
    (defun c:mdTEST ()
    (movedown (getset "\nSet to move down: ") 1)
    (princ)
    );end defun c:md ()

    ;;;*down* is a global = (* pi 1.5)
    (defun movedown (inputSet inputDist )
    (if inputSet
    (moveset inputSet *down* inputDist)
    )
    )

    (defun moveset (inputSet dirToMove distToMove)
    (command "move" inputSet "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    (princ)
    );end defun c:md ()

    (defun GetSet ( prmpt / selset)
    (or(setq selset (ssget "I"))
    (progn
    (if prmpt(prompt prmpt))
    (setq selset (ssget))
    );prong
    )
    selset
    )

    result at textscreen:
    Command: MDTEST
    move
    Select objects: 1 found

    Select objects:
    Select objects: _NON 0 found
    Select objects: _NON Specify opposite corner: *Cancel*
    0 found


    I would much rather figure out how to use transformations but just don't
    have time at the moment to delve into it further than my current meager
    understanding to revise bunches of old quickie commands like the above.
     
    R. Robert Bell, Jun 8, 2004
    #6
  7. MP

    MP Guest

    Yep, I bet it's some sysvar but even with those same settings it doesn't
    work here, so there must be some other pesky var I've forgotten about that
    isn't set right.

    however, by adding an extra "" it works. - weird
    (defun moveset (inputSet dirToMove distToMove)
    (if inputSet

    ;(command "move" inputSet "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    ;;;;added xtra "" to make work in 2005
    (command "move" inputSet "" "" "_NON" '(0 0 0 ) "_NON" (polar '(0 0 0 )
    dirToMove distToMove))
    )
    )
    (princ)
    )

    oh, I spoke too soon,
    it works if something is preselected,
    it fails if something is not preselected
    (when calling the GetSet function)
    (with the added "")
     
    MP, Jun 8, 2004
    #7
  8. MP

    Rakesh Rao Guest

    When everything else fails, depend on the good old solution. Restart
    your AutoCAD. If that does not work, restart your computer also. If that
    also does not work, make sure you test with nothing else loaded prior to
    your program during startup.

    BTW, it works perfectly for me here.

    Regards
    Rakesh

    --
    --
    - Rakesh Rao [ rakesh.rao (at)4d-technologies.com ]
    - Four Dimension Technologies
    [www.4d-technologies.com]
    - Get GeoTools, Work smarter: www.4d-technologies.com/geotools
    - Free Lisp downloads @ TechCenter: www.4d-technologies.com/techcenter
     
    Rakesh Rao, Jun 8, 2004
    #8
  9. MP

    Joe Burke Guest

    A shot in the dark. The old undocumented sysvar QAFLAGS has an affect on how
    selection sets are handled. It should be set to zero.

    I don't have 2005 to see how it behaves there.

    Joe Burke
     
    Joe Burke, Jun 8, 2004
    #9
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.