I can't figure out why when I manually enter the command it doesn't cause a regeneration of the model, but when I run my code, it causes it twice.
(defun C:PJ ()
(get_CurrentState)
(setvar "CMDECHO" 0)
(setvar "PEDITACCEPT" 1)
(COMMAND ".PEDIT" PAUSE "JOIN" "ALL" "" "")
(cond
((= (...