Author Topic: Pass selectionset to Join command  (Read 1730 times)

0 Members and 1 Guest are viewing this topic.

kozmos

  • Newt
  • Posts: 114
Pass selectionset to Join command
« on: December 14, 2023, 07:30:22 AM »
I tried to use command (and command-s and vl-cmdf) to call Join command, and passing a preselected objects to these commands, but they do not work. Anyone has any ideas how to fix it?

(Defun c:TT (/ ss)
  (if (setq ss (ssget))
       (command "_.join" ss "")
  )
)

Calling C:TT will not join the selected lines.
KozMos Inc.

dexus

  • Bull Frog
  • Posts: 208
Re: Pass selectionset to Join command
« Reply #1 on: December 14, 2023, 08:01:12 AM »
I'm not sure why, but this seems to work:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:join-the-swamp (/ ss)
  2.   (if (setq ss (ssget))
  3.        (command "_.join" ss ss "")
  4.   )
  5. )

Marc'Antonio Alessi

  • Swamp Rat
  • Posts: 1453
  • Marco
Re: Pass selectionset to Join command
« Reply #2 on: December 14, 2023, 08:30:24 AM »
The (command) version is different from the pure command.


Try (command "_.join") and see what it ask...

kozmos

  • Newt
  • Posts: 114
Re: Pass selectionset to Join command
« Reply #3 on: December 14, 2023, 10:15:16 AM »
with somne search online, I found the answer: https://www.cadtutor.net/forum/topic/55336-join-command/
need to call (initcommandversion) before calling "_.join"
KozMos Inc.