Author Topic: strange bug: error: Automation Error. Invalid Argument  (Read 2670 times)

0 Members and 1 Guest are viewing this topic.

KewlToyZ

  • Guest
strange bug: error: Automation Error. Invalid Argument
« on: December 01, 2006, 02:58:03 PM »
I keep running into this bug with a lisp routine for setting primary profile paths in 2007.
I can have this routine run perfectly fine, VLIDE doesn't detect any problems.
But on some XP machines, no matter what I do it refuses to run.
I checked the paths and they are all mapped properly on the machine, but it fails.
I have 1 in 10 machines fail with this routine and it has me stumped.

I tried remming out the menuloads, added some conditions for running the menuloads, but it still fails.
Any ideas would be appreciated.

(defun C:s07 ()
  (vla-put-supportpath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    (strcat
      "N:\\2007 KTA\\General;"
      "N:\\2007 KTA\\Support;"
      "N:\\2007 KTA\\MENU;"
      "N:\\2007 KTA;"
      "N:\\2007 KTA\\CAD;"
      "J:\\_Plotters\\TrueView Plotting\\Fonts;"
      "%UserProfile%\\Application Data\\Autodesk\\AutoCAD 2007\\R17.0\\enu\\Support;"
      "C:\\Program Files\\AutoCAD 2007\\Support;"
      "C:\\Program Files\\AutoCAD 2007\\Fonts;"
      "C:\\Program Files\\AutoCAD 2007\\Help;"
      "C:\\Program Files\\AutoCAD 2007\\Express;"
     )
  )
  (vla-put-printerdescpath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    "J:\\_Plotters\\TrueView Plotting\\drv"
  )
  (vla-put-printerstylesheetpath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    "J:\\_Plotters\\TrueView Plotting\\Plot Styles"
  )
  (vla-put-printerconfigpath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    "J:\\_Plotters\\TrueView Plotting\\Plotters"
  )
  (vla-put-ToolPalettePath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    "N:\\2007 KTA\\Palettes"
  )
               ;(if (null (menugroup "kta_dim"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_dim.cui")
               ; )
               ;(if (null (menugroup "kta_elec"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_elec.cui")
               ; )
               ;(if (null (menugroup "kta_format"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_format.cui")
               ; )
               ;(if (null (menugroup "kta_mech"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_mech.cui")
               ; )
               ;(if (null (menugroup "kta_plum"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_plum.cui")
               ; )
               ;(if (null (menugroup "kta_quicktools"))
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_quicktools.cui"
               ; )
               ; )
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_dim.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_elec.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_format.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_mech.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_plum.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_quicktools.cui")
               ;  (command "menuunload" "KTA_ACAD")
               ;  (command "menuunload" "KTA_DIM")
               ;  (command "menuunload" "KTA_DRAW")
               ;  (command "menuunload" "KTA_ELEC")
               ;  (command "menuunload" "KTA_FILE")
               ;  (command "menuunload" "KTA_FORMAT")
               ;  (command "menuunload" "KTA_INSERT")
               ;  (command "menuunload" "KTA_MECH")
               ;  (command "menuunload" "KTA_MODIFY")
               ;  (command "menuunload" "KTA_PLUM")
               ;  (command "menuunload" "KTA_TOOLS")
               ;  (command "menuunload" "KTA_VIEW")
               ;  (command "menuunload" "MY_CUSTOM")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_acad.cui")
               ;  (command "menuunload" "KTA_DIM")
               ;  (command "menuunload" "KTA_DRAW")
               ;  (command "menuunload" "KTA_ELEC")
               ;  (command "menuunload" "KTA_FILE")
               ;  (command "menuunload" "KTA_FORMAT")
               ;  (command "menuunload" "KTA_INSERT")
               ;  (command "menuunload" "KTA_MECH")
               ;  (command "menuunload" "KTA_MODIFY")
               ;  (command "menuunload" "KTA_PLUM")
               ;  (command "menuunload" "KTA_TOOLS")
               ;  (command "menuunload" "KTA_VIEW")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_dim.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_draw.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_elec.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_format.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_insert.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_mech.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_modify.cui")
               ;  (command "menuload" "N:\\2007 KTA\\MENU\\kta_plum.cui")
)
« Last Edit: December 01, 2006, 02:59:57 PM by KewlToyZ »

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: strange bug: error: Automation Error. Invalid Argument
« Reply #1 on: December 01, 2006, 08:45:24 PM »
Ok, a few quick questions ....

1) Do the paths get added in AutoCAD, meaning can you click the support file options in the preferences window and see the paths properly set?

2) Have you verified if the paths are being properly written to the registry for the profile you are selecting?

3) Are any of the paths being duplicated in the support path options?

The reason I ask is because I have found instances where you may be able to add another instance of an existing path to the current path, i.e. there may be 2 instances of "C:\\Program Files\\AutoCAD 2007\\Support;" This will cause an issue on some installations of Windows XP, I think due to the registry handling functions either within XP or AutoCAD itself. This is not limited to R2007, but can rear its ugly head from R2000 through R2007, particularly on unpatched versions of A2k, A2ki, and A2k4 running XP w/sp2.
I have not found a resolution to this as of yet, but I am always looking for something to help in its resolution.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Andrea

  • Water Moccasin
  • Posts: 2372
Re: strange bug: error: Automation Error. Invalid Argument
« Reply #2 on: December 01, 2006, 09:42:48 PM »
the problem i got..is the inexisting path...

try this...

Code: [Select]

(if (vl-file-directory-p "j:\\_Plotters\\TrueView Plotting\\Plot Styles")
  (vla-put-printerdescpath
    (vla-get-files (vla-get-preferences (vlax-get-acad-object)))
    "j:\\_Plotters\\TrueView Plotting\\drv"
  )(alert "Invalid Printer description PATH")
)


same with ...printerstylesheetpath  ...printerconfigpath ..etc..

or if you want to resolve your problem....

Code: [Select]
(setenv "PrinterDescDir" "j:\\windows_Plotters\\TrueView Plotting\\Plot Styles")
« Last Edit: December 01, 2006, 09:52:24 PM by Andrea »
Keep smile...

KewlToyZ

  • Guest
Re: strange bug: error: Automation Error. Invalid Argument
« Reply #3 on: December 13, 2006, 02:46:44 PM »
Thanks for the help :)
Happy Holidays !!