Author Topic: getting .arx error with this code. need fresh set of eyes  (Read 2222 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
getting .arx error with this code. need fresh set of eyes
« on: April 11, 2014, 11:16:09 AM »
when running the following code im getting this error:
c:\program files\autodesk\autocad 2014\acadm\amg3dim.arx cannot find a dll or other file that it needs.
Unknown command "B".  Press F1 for help.
Unknown command "L-89-5".  Press F1 for help.
Unknown command "N".  Press F1 for help.

anyone know what this means and what would cause this?
the program works as i need it to, but im trying to eliminate these issues.

thanks for any help

Code: [Select]
(defun UpdateAtt (tagstring newvalue / newvalue ss1 tagstring)
  (if (setq tagstring (strcase tagstring)
    ss1       (ssget "X" '((0 . "INSERT") (66 . 1)))
      )
    (mapcar
      (function (lambda (att) (vla-put-textstring att newvalue)))
      (vl-remove-if-not
(function (lambda (att)
    (= tagstring (strcase (vla-get-tagstring att)))
  )
)
(apply
  'append
  (mapcar (function (lambda (ent)
      (vlax-invoke
(vlax-ename->vla-object ent)
'GetAttributes
      )
    )
  )
  (vl-remove-if-not
    (function (lambda (x) (= 'ENAME (type x))))
    (apply 'append (ssnamex ss1))
  )
  )
)
      )
    )
  )
)

(defun ub (/ oldblock_lst newblock_lst c oblk nblk olay ss ent elist x ip nlay)
(SETQ DS (GETVAR "DIMSCALE"))
(setvar "cmdecho" 0)
(setq oldblock_lst (list (strcase "l-89-1") (strcase "l-89-2") (strcase "l-89-3")
                         (strcase "l-89-5") (strcase "tag-l") (strcase "tag-m")
                         (strcase "tag-s")
                   )
)
(setq newblock_lst (list "naotag-l" "naotag-l" "naotag-m"
                         "naotag-s" "naotag-l" "naotag-m"
                         "naotag-s"
                   )
)
(setq C 0)
(repeat
(length oldblock_lst)
(setq oblk (nth C oldblock_lst)
      nblk (nth C newblock_lst)
)

(command "_purge" "B" oblk "n")     ; purge block if not visible
(if (tblsearch "block" oblk)
;;
  (progn
   (setq olay (getvar "clayer"))
   (setq ss nil)
   (setq ss (ssget "X" (list (cons 2 oblk))))
   (setq ent (ssname ss 0)) ;
   (setq elist (entget ent)) ; entity list
   (setq x (cdr (assoc 41 elist))) ; Scale
   (setq ip (cdr (assoc 10 elist))) ; Insertion point
   (setq nlay (cdr (assoc 8 elist))) ; Get Block Layer

     (if ss
      (progn
        (command "_erase" ss "") ; erase block
        (command "_purge" "B" oblk "n")         ; purge block
        (SETVAR "CLAYER" nlay)         ; make old block layer current
        (command "-insert" nblk ip x "" "")     ; insert new block
        (SETVAR "CLAYER" olay)         ; reset layer
      ) ; progn
    ) ;if ss
  ) ;progn
;;
); if
(setq C (+ C 1))
); repeat
(setvar "cmdecho" 1)
(princ)
)

(ub)

(UPDATEATT "JOBNO"
   (substr (vl-Filename-Base
     (vl-Filename-Directory (getvar "Dwgprefix"))
   )
   1
   6
   )
)
(UPDATEATT "ORDER-#"
   (substr (vl-Filename-Base
     (vl-Filename-Directory (getvar "Dwgprefix"))
   )
   1
   6
   )
)


owenwengerd

  • Bull Frog
  • Posts: 451
Re: getting .arx error with this code. need fresh set of eyes
« Reply #1 on: April 11, 2014, 11:24:30 AM »
The problem has nothing directly to do with your code. Your AutoCAD Mechanical installation appears to be corrupt.

andrew_nao

  • Guest
Re: getting .arx error with this code. need fresh set of eyes
« Reply #2 on: April 11, 2014, 11:36:45 AM »
but i only get that error when i run this code and no other code.

i tried it on another work station and still same results. surely it cant be 2 installs corrupt.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: getting .arx error with this code. need fresh set of eyes
« Reply #3 on: April 11, 2014, 12:05:26 PM »
To debug I think you should set cmdecho to 1. That way you can see more clearly what is going on. One way the error can be explained is if a nblk has an attribute. This attribute would receive the "_purge" string and the next command would then be "B".

owenwengerd

  • Bull Frog
  • Posts: 451
Re: getting .arx error with this code. need fresh set of eyes
« Reply #4 on: April 11, 2014, 12:54:57 PM »
i tried it on another work station and still same results. surely it cant be 2 installs corrupt.

The DLL error is not your code, per se. Your code is triggering a demand-load when you access the entity defined in amg3dim.arx, but your code is not causing the load error. I assumed that the rest of your issues stem from that failure, but maybe not.