Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

error: Automation Error. Description was not provided.

7 REPLIES 7
Reply
Message 1 of 8
Mike--
5094 Views, 7 Replies

error: Automation Error. Description was not provided.

i have this routine, but sometimes have a error

; error: Automation Error. Description was not provided.
Why??
i use o MDT2009
windows XP 64bits

(defun c:Symdim (/ dim1 name1 qty1 listblock vlaobj ilist linfo list2 z1 z2 qt1 qt2 dg1 dg2 aux alist2)
(vl-load-com)
(setq lInfo '() list2 '())
(setq md1 (getvar "ctab"))
(setq dim1 "=Sym ")
(setq name1 "=")
(setq qty1 "=")
;(princ dim1)
(command "ammode" "Drawing")
(setq listblock(ssget "x" '((0 . "ACMPARTLIST"))))
(if (= listblock nil)()
(progn
(setq vlaobj (vlax-ename->vla-object (ssname listblock 0)))
(setq ilist (vlax-get-property vlaobj 'itemlist))
(setq lInfo(vlax-safearray->list
(vlax-variant-value
(vlax-get-property
(vlax-invoke-method Ilist 'item 0)'data)))
)
;(princ linfo)
(Setq z1 (assoc "DIMENSÕES" linfo) z2 (list "DIMENSÕES" dim1))
(setq linfo (subst z2 Z1 linfo))
(Setq dg1 (assoc "DESIGNAÇÃO" linfo) dg2 (list "DESIGNAÇÃO" name1))
(setq linfo (subst dg2 dg1 linfo))
(Setq qt1 (assoc "QT" linfo) qt2 (list "QT" qty1))
(setq aux (cadr qt1))
(if (= aux "1")(setq list2 (subst qt2 qt1 linfo))(setq list2 linfo))
;(princ list2)
(setq alist2(vlax-make-safearray vlax-vbString (cons 0 (1-(length list2)))'(1 . 2)))
;(princ alist2)
(setq alist2(vlax-make-variant (vlax-safearray-fill alist2 list2)))
(vlax-put-property(vlax-invoke-method Ilist 'item 0)'data alist2)
(vlax-release-object ilist)
(vlax-release-object vlaobj)
))
(if (= md1 "Model")
(progn
(command "ammode" "model")
(command "vpoint" "-1,-1,1")
(command "-SHADEMODE" "g")
)
)
(princ)
)

Point your RSS reader here for a feed of the latest messages in all forums
Go Back Back to Thread List
Threads: [ Previous | Next ]


© Copyright 2009 Autodesk, Inc. All rights reserved. Legal Notices & Trademarks -- Privacy Policy
7 REPLIES 7
Message 2 of 8
Ken.Krupa
in reply to: Mike--

I haven't tried this, and don't have MDT. But, as a general purpose debugging technique, do (vl-bt) before running your routine. That will give you code spill-out to show you where the problem is, which will usually help you solve it.

Ken Krupa
Krupa CADD Solutions
http://www.krupacadd.com
Message 3 of 8
Mike--
in reply to: Ken.Krupa

the problem is in some drawings is work well ,another drawings don´t work.

 

the command (vlax-put-property    (vlax-invoke-method Ilist 'item 0)     'data     alist2) give the error

 

 

the (vl-bt)  give this:

 

Backtrace:
[0.59] (VL-BT)
[1.55] (*ERROR* "Automation Error. Description was not provided.") LAP+7
[2.49] (_call-err-hook #<USUBR @000000004f3e31b0 *ERROR*> "Automation Error.
Description was not provided.")
[3.43] (sys-error "Automation Error. Description was not provided.")
:ERROR-BREAK.38 "Automation Error. Description was not provided."
[4.35] (intelligent-invoke #<VLA-OBJECT IMcadBOMItem3 00000000294d2a98> DATA 4
#<variant 8200 ...>)
[5.27] (vlax-put-property #<VLA-OBJECT IMcadBOMItem3 00000000294d2a98> DATA
#<variant 8200 ...>)
[6.20] (C:MB_SYMDIM) LAP+629
[7.15] (#<SUBR @000000004f3e3b10 -rts_top->)
[8.12] (#<SUBR @000000002e80c700 veval-str-body> "(C:MB_SYMDIM)" T #<FILE
internal>)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0)

Message 4 of 8
scottbolton
in reply to: Mike--

Mike,

 

It might be a good idea to attach one of the drawings that works and one that doesn't. That way we'll have any layers, blocks, etc. necessary.

 

That said, it's going-home time in my neck of the woods, but perhaps someone further west could help.

 

S

Message 5 of 8
Ken.Krupa
in reply to: Mike--

Mike - some suggestions:

 

Unlocalize your variables (temporarily, for testing)

 

Separate this line: (vlax-put-property(vlax-invoke-method Ilist 'item 0)'data alist2)

into two:

(setq obj (vlax-invoke-method Ilist 'item 0))

(vlax-put-property obj 'data alist2)

 

Run it (doing vl-bt first), and examine your variables. Use (vl-dump-object obj) to see what it is, and whether it actually has a data property available. Check alist2, and the variables that went into it. I think you'll be sure to find something not as it should be, which you can then either correct or trap for.

 

Ken Krupa
Krupa CADD Solutions
http://www.krupacadd.com
Message 6 of 8
Mike--
in reply to: Ken.Krupa

the problem is the command ammassprop, when i choose the material for the part

In  ok.dwg the function work well ,when i do the command ammassprop, the function dont work

 

 

Command: (vlax-dump-object obj)
; IMcadBOMItem3: IMcadBOMItem3 Interface
; Property values:
;   Application (RO) = #<VLA-OBJECT IAcadApplication 0000000140d28e28>
;   AutoCalculateEnabled = -1
;   Balloons (RO) = #<VLA-OBJECT IMcadBalloons 000000008025cde8>
;   BOM (RO) = #<VLA-OBJECT IMcadBOM3 0000000080b88a08>
;   Data = multi dimension safearray not supported
;   Document (RO) = #<VLA-OBJECT IAcadDocument 000000008166a740>
;   ExcludeFromPartList = 0
;   Expanded = 0
;   Handle (RO) = "C94"
;   HasExtensionDictionary (RO) = 0
;   IsExpandable (RO) = 0
;   ItemNumber = "1"
;   ObjectID (RO) = 42
;   ObjectID32 (RO) = 42
;   ObjectName (RO) = "AcmBomRow"
;   OwnerID (RO) = 43
;   OwnerID32 (RO) = 43
;   Phantomed (RO) = 0
;   Quantity = 1
;   SortPriority = 1000
T

Message 7 of 8
Ken.Krupa
in reply to: Mike--

I'm still at a disadvantage in that I don't have MDT, but maybe I can help anyway. The problem seems to be here:

;   Data = multi dimension safearray not supported

so you need to trap for that. You might try this:

(if (vlax-property-available-p obj 'data)

  (progn

    (vlax-put-property obj 'data alist2)

    ; do everything else here

  )

  ; else

  (princ "\nSkipping object - data property not available. ")

)

 

If vlax-property-available-p returns T for this (I can't test without having MDT), then use vl-catch-all-apply instead:

(setq catch (vl-catch-all-apply 'vlax-put-property (list obj 'data alist2)))

(if (vl-catch-all-error-p catch)

  (princ "\nSkipping object - data property not available. ")

  ;else

  (progn

    ; do everything else here

  )

)

 

Ken Krupa
Krupa CADD Solutions
http://www.krupacadd.com
Message 8 of 8
Mike--
in reply to: Ken.Krupa

i only change

(vlax-put-property obj 'data alist2)

 

for this

(setq catch (vl-catch-all-apply 'vlax-put-property (list obj 'data alist2)))

 

 

and resulted....  thanks ken

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost