Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

My grouping LISP no longer works, HELP!

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
pete592
484 Views, 4 Replies

My grouping LISP no longer works, HELP!

I have been using a LISP routine to simulate the old 'group' commands in AutoCAD Mechanical 2012.

This program has worked flawlessly for SEVEN STRAIGHT YEARS, including my current install of AutoCAD.

 

Suddenly and mysteriously, it has stopped working.  The program starts normally, asking the user to select the objects to group, then appears to complete normally, but the selected objects are not grouped.

 

Other users in my office on the same CAD version can use this program with the expected results.  The problem is limited only to my installation.  I have tried compete reboots of both AutoCAD and my entire system, but to no avail.

 

Is there a system variable that could be causing this? Or anything else that may come to mind?

 

Thanks,

Pete

 

Here is the LISP code...

 

; Description: File contains functions used to simulate old AutoCAD "group"
; commands. File is always loaded on AutoCAD startup to insure command
; availability.
;
; Revisions:   08/29/06 - Updates for AutoCAD 2007.
;
(defun c:mgrp ( / ss)
   (princ "\nSelect object to group: ")
   (if (setq ss (ssget))
      (command "-group" "_create" "*" "" ss "")
   )
   (princ)
)

(defun c:dgrp ( / ent gname)
   (if (setq ent (car (entsel "\nSelect group to ungroup: ")))
      (if (and (gnames ent) (setq gname (nth 0 (gnames ent))))
         (command "-group" "explode" gname)
         (princ "\nSelected object is not a member of a group.")
      )
   )
   (princ)
)

(defun gnames (ename / key dct rtn)
   (setq key (cons 340 ename)
         dct (dictsearch (namedobjdict) "acad_group"))
   (while (setq dct (member (assoc 3 dct) dct))
      (if (member key (entget (cdadr dct)))
         (setq rtn (cons (cdar dct) rtn))
      )
      (setq dct (cddr dct))
   )
   (reverse rtn)
)
(princ)

4 REPLIES 4
Message 2 of 5
pendean
in reply to: pete592

CTRL+SHIFT+A or manually set PICKSTYLE back, does it work now? Your lisp doesn't check or address it if it is turned off.
Message 3 of 5
pete592
in reply to: pendean

EXCELLENT.  Thank you so much!

 

I'm going to read up on PICKSTYLE.  You're probably amazed I'm not the least bit familiar with it.

Message 4 of 5
pendean
in reply to: pete592

it's hard keeping track all of them: edit your Lisp to always turn it on if that was the cure.
Message 5 of 5
pete592
in reply to: pendean

I will. 

Thanks again!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost