Bonjour à tous, Je suis nouveau sur CADxp, je prend la chance de vous exposé mon problème. J'ai reprit un lisp et changer les chemins. mais j'ai une "Erreur : type d'argument incorrect: stringp nil" le lisp est supposé aller chercher le profile et le charger. et le chemin est bien écrit. merci, de me donner un coup de main avec ceci. ;;===========code start============
(prompt "\nType LoginProfile to run......")
(vl-load-com)
(defun C:LoginProfile (/ profilename acadprofiles actprofile thelist profilepath)
;;retrieve the users login name
(setq profilename (strcase (getvar "NEUF_2018")))
;;retrieve a reference to the Profiles
(setq acadprofiles
(vla-get-profiles
(vla-get-preferences (vlax-get-Acad-Object))
)
)
;;retrieve the Active Profile
(setq actprofile (strcat (vla-get-ActiveProfile acadprofiles)))
;;if they are not the same
(if (/= profilename actprofile)
;;do the following
(progn
;;get a list of the loaded profiles
(vlax-invoke-method acadProfiles 'GetAllProfileNames 'thelist)
;;convert to a list
(setq thelist (vlax-safearray->list thelist))
;;if the profile is not in the list
(if (not (member profilename thelist))
;;do the following
(progn
;;store the profile file
(setq profilepath
(strcat "\\architecture.local\NEUF\Outils\Y-Système\Y1-Autocad\2018\Y14-Routines\NEUF_2018_ARG\Deploy_2018"
profilename
".arg"
)
)
;;if the profile is found
(if (findfile profilepath)
;;do the following
(progn
;;load the profile
(setq NewProfile
(vlax-invoke-method
acadprofiles 'ImportProfile profilename profilepath :vlax-true)
)
;;make the profile the Active Profile
(vla-put-ActiveProfile acadProfiles profilename)
) ;_ progn
;;profile file cannot be found - exit
(prompt (strcat "\nCannot find profile " profilepath))
) ;_ if
) ;_ progn
;;it is loaded but make the profile the Active Profile
(vla-put-ActiveProfile acadProfiles profilename)
) ;_ if
) ;_ progn
;;We could reload the Profile if we wish.
;;Just uncomment the next line.
;;(vlax-invoke-method acadProfiles 'ResetProfile profilename)
) ;_ if
(princ)
) ;_;defun
(princ)
;;========== end code===========