Weird Error - Can't figure

Discussion in 'AutoCAD' started by cadman_meg, Aug 19, 2003.

  1. cadman_meg

    cadman_meg Guest

    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.
     
    cadman_meg, Aug 19, 2003
    #1
  2. 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.
    |
     
    R. Robert Bell, Aug 19, 2003
    #2
  3. cadman_meg

    cadman_meg Guest

    That's right. They aren't being deleted.
     
    cadman_meg, Aug 19, 2003
    #3
  4. cadman_meg

    cadman_meg Guest

    Robert,

    This still doesn't work. When I execute it, nothing happens and nothing is shown in the command line.
     
    cadman_meg, Aug 19, 2003
    #4
  5. 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*


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


    | Robert,
    | This still doesn't work. When I execute it, nothing happens and nothing is
    shown in the command line.
    |
     
    R. Robert Bell, Aug 19, 2003
    #5
  6. cadman_meg

    cadman_meg Guest

    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.
     
    cadman_meg, Aug 19, 2003
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.