getting viewport scale crashes autocad...

Discussion in 'AutoCAD' started by Mark Dubbelaar, Jul 29, 2003.

  1. hi

    i have been using the following code for a while now, and have found that
    every now and then it crashes autocad, i've think its somewhere in getting
    the assoc 41 or 45, but can't figure out where or why it is doing this...
    has anyone else had a similar problem / solution???

    any help would be great

    cheers

    mark



    ;code
    (setq SelectedObject
    (entsel
    "\nSelect viewport or Enter 'Bar Scale' scale: 1:"
    )
    )
    (if (= (cdr (assoc 0 (entget (car SelectedObject)))) "VIEWPORT")
    (progn
    (setq VIEWPORTENTITY (entget (car SelectedObject)))
    (setq VIEWPORT_SCALE
    (/ (cdr (assoc 41 VIEWPORTENTITY))
    (cdr (assoc 45 VIEWPORTENTITY))
    )
    )
    ) ;progn
    (progn
    (setq VIEWPORTENTITY
    (entget
    (cdr
    (assoc 330 (entget (car SelectedObject)))
    )
    )
    )
    (setq VIEWPORT_SCALE
    (/ (cdr (assoc 41 VIEWPORTENTITY))
    (cdr (assoc 45 VIEWPORTENTITY))
    )
    )
    ) ;progn
    ) ;if
     
    Mark Dubbelaar, Jul 29, 2003
    #1
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.