TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: kozmos on December 14, 2023, 07:30:22 AM

Title: Pass selectionset to Join command
Post by: kozmos 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.
Title: Re: Pass selectionset to Join command
Post by: dexus 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. )
Title: Re: Pass selectionset to Join command
Post by: Marc'Antonio Alessi 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...
Title: Re: Pass selectionset to Join command
Post by: kozmos 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"