Clint Posted 10 hours ago Posted 10 hours ago (edited) I obtained the attached program from another. In initial running of this program ONLY, I am experiencing the subject line error. (I run this in BricsCAD V25 & V26) The program continues to run and produces the desired results. IMPORTANT In later runs, it does not appear. BACKGROUND I attempted to debug in the BricsCAD BLADE programming environment (similar to AutoCAD's VLIDE) but have limited experience so far. QUESTIONS What is causing the following error? How do I correct it? -------- COMMAND ERROR MESSAGE ------- Select groups to be exploded: Select entities: Entities in set: 9 Select entities: ; error : Automation Error. Property [NAME] not available ------ Best regards, Clint Hill quickungroup.lsp Edited 10 hours ago by Clint Quote
rlx Posted 8 hours ago Posted 8 hours ago untested ;;; (setq g-name (get_groupname (car (entsel)))) (defun GET_GROUPNAME ( ent / d gl o id lst) (setq d (vla-get-activedocument (vlax-get-acad-object)) gl (vla-get-groups d)) (setq o (vlax-ename->vla-object ent) id (vla-get-ObjectID o)) (vlax-for g gl (vlax-for e g (if (equal (vla-get-ObjectID e) id) (setq lst (cons (vla-get-Name g) lst)))(vlax-release-object e))(vlax-release-object g)) (if (vl-consp lst)(car lst)) ) Quote
Clint Posted 8 hours ago Author Posted 8 hours ago I appreciate and will insert your code and will try it, rlx! Quote
mhupp Posted 56 minutes ago Posted 56 minutes ago While its good coding practice to have basic individual functions so you can see where errors show up or reuse code else where in a later project without having to Frankenstein parts from other longer code. This is simple enough to do all in one function. your notes and ques talk about explode but if their wasn't an error would be deleting. (defun C:QU (/ P SS) (vl-load-com) (setq P (getvar 'PICKSTYLE)) (vla-startundomark (setq Doc (vla-get-activedocument (vlax-get-acad-object)))) (setvar 'PICKSTYLE 1) (princ "\nSelect Entities to Delete: ") (if (setq SS (ssget)) (foreach obj (mapcar 'vlax-ename->vla-Object (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS)))) (vla-delete obj) ) (princ "\n Nothing Selected") ) (setvar 'PICKSTYLE P) (vla-Regen Doc acAllViewports) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.