Ahh, now I understand . . . You just want to add an 's' to a specific filter name.
. . . but you don't seem to be checking if the layerFilter you are renaming actually exists.
I assume you want to batch process drawings, or run this as part of a config routine, but you do realise that Right-click on the Filter name offers a rename option.
Regards,
added:
a piccy if 'Renamed' filter does not exist
Thanks kdub, I'll take a look at this. Is your safeitem routine a shortened method for getting at the filters collection by using vla-item?
#<VLA-OBJECT IAcadLayer 0000021e6f957cd8>
nil
; error: Automation Error. Key not found
Perhaps something like :
(may not be bomb proof :)Code - Auto/Visual Lisp: [Select]
) newName "Fruitiers" ) (setq extensionDict ) (setq layerFilters (kdub:safeitem extensionDict "ACAD_LAYERFILTERS") ) ) ) ;;else ;;(vla-put-Name layerFilter newName) ) ;;else ) ) ;;else ;; ) ) ;;;-------------------------------------------------------------------- (setq returnvalue ) ) ) ) returnvalue ) ) ;;;--------------------------------------------------------------------
Command: DOTEST
._-layer
Current layer: "Apple"
Enter an option [?/Make/Set/New/Rename/ON/OFF/Color/Ltype/LWeight/TRansparency/MATerial/Plot/Freeze/Thaw/LOck/Unlock/stAte/Description/rEconcile/Xref]: filter
Current layer filter: "All"
Enter a layer filter option [New/Set/Rename/Edit/Delete/eXit]: Rename
Enter layer filter to rename: Fruit Drops
Enter new layer filter name: Fruit Dropper
Current layer filter: "All"
Enter a layer filter option [New/Set/Rename/Edit/Delete/eXit]:
Command:
Filter name was changed.