Weird Error - Can't figure

cadman_meg

Usenet Archive
Joined
Jul 14, 2003
Messages
51
Reaction score
0
Upon executing this routine:

; Written By: Peter Jamtgaard
; This program will delete all unused dimstyles.

(defun C:PurgeDimStyles
 (vl-load-com)
 (vlax-for DSTYOBJ
           (vla-get-dimstyles             (vla-get-activedocument              (vlax-get-acad-object)             )            )   (vl-catch-all-apply 'vla-delete (list DSTYOBJ))  )
)

I got this message "#<%catch-all-apply-error%>"

Not sure what to do to fix it or why this is happening. There are 3 unused dimstyles in the test drawing. Help is very much appreciated. Thanks.
 
Peter just wasn't cleaning up after himself:

(defun C:PurgeDimStyles
(vl-load-com)
(vlax-for DSTYOBJ
(vla-get-dimstyles
(vla-get-activedocument
(vlax-get-acad-object)
)
)
(vl-catch-all-apply 'vla-delete (list DSTYOBJ))
)
(princ) ; <- added
)

However, are you saying that the unused dimstyles are *not* being deleted anyway?

--
R. Robert Bell, MCSE
www.AcadX.com

| Upon executing this routine:
| ; Written By: Peter Jamtgaard
| ; This program will delete all unused dimstyles.
|
| (defun C:PurgeDimStyles
| (vl-load-com)
| (vlax-for DSTYOBJ
| (vla-get-dimstyles
| (vla-get-activedocument
| (vlax-get-acad-object)
| )
| )
| (vl-catch-all-apply 'vla-delete (list DSTYOBJ))
| )
| )
|
| I got this message "#<%catch-all-apply-error%>"
|
| Not sure what to do to fix it or why this is happening. There are 3 unused dimstyles in the test drawing. Help is very much appreciated. Thanks.
|
 
Robert,

This still doesn't work. When I execute it, nothing happens and nothing is shown in the command line.
 
Are you sure they are unreferenced?

New drawing:

Command: Dim

Dim: save
Enter name for new dimension style or [?]: ?
Enter dimension style(s) to list <*>:
Named dimension styles:
Standard
Enter name for new dimension style or [?]: Bad1

Dim: save
Enter name for new dimension style or [?]: ?
Enter dimension style(s) to list <*>:
Named dimension styles:
Standard
Bad1
Enter name for new dimension style or [?]: Bad2

Dim: restore
Enter a dimension style name, [?] or <select dimension>: ? Enter dimension style(s) to list <*>:
Named dimension styles:
Standard
Bad1
Bad2
Enter a dimension style name, [?] or <select dimension>: standard Current dimension style: Standard

Dim: exit

Command: (defun C:PurgeDimStyles
(_> (vl-load-com)
(_> (vlax-for DSTYOBJ
((_> (vla-get-dimstyles
(((_> (vla-get-activedocument
((((_> (vlax-get-acad-object)
((((_> )
(((_> )
((_> (vl-catch-all-apply 'vla-delete (list DSTYOBJ))
((_> )
(_> (princ) ; <- added
(_> )
C:PURGEDIMSTYLES

Command: purgedimstyles
Command:
Command: dim

Dim: restore
Enter a dimension style name, [?] or <select dimension>: ? Enter dimension style(s) to list <*>:
Named dimension styles:
Standard
Enter a dimension style name, [?] or <select dimension>: *Cancel*
 
Duh, I was going into the text style command and not the dim style command. Must be a long day for me not to notice that. Much appreciate the help.
 

Latest threads

Back
Top