TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: deegeecees on October 04, 2005, 03:47:31 PM
-
I'm stuck:
(defun prof_comed_out ()
(setq profilename1 (strcat "ComEd_" cad_ver "_" use1))
(setq profilepath1 (strcat "\\\\lisledc2\\projectscomed\\std\\acad\\profiles\\" profilename1 ".arg"))
(setq NewProfile1 (vlax-invoke-method acadprofiles1 'ExportProfile profilepath1))
)
Returns this:
Command: (prof_comed_out) ; error: bad argument type: VLA-OBJECT nil
I just need a little nudge in the right direction.
Notes:
1. cad_ver = Version (15, 16 etc.)
2. use1 = loginname
These are defined before prof_comed_out.
-
Little nudge: Where is acadprofiles1 being set?
-
I see...
(setq acadprofiles (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object))))
Thought that might work, but to no avail.
Hold The Phone...!
(setq acadprofiles1 (vla-get-profiles (vla-get-preferences (vlax-get-Acad-Object))))
Now returns:
Command: (prof_comed_out) ; error: too few actual parameters
-
Couple nudges ...
How many arguments does the ExportProfile method expect?
(vlax-dump-object
(setq profiles
(vla-get-profiles
(vla-get-preferences
(vlax-get-acad-object)
)
)
)
t
)
; IAcadPreferencesProfiles: This object contains the options from the Profiles tab on the Options dialog
; Property values:
; ActiveProfile = "BanR2002"
; Application (RO) = #<VLA-OBJECT IAcadApplication 00b07a68>
; Methods supported:
; CopyProfile (2)
; DeleteProfile (1)
; ExportProfile (2) Hmmm, requires 2 arguments. Wonder what they are ...
; GetAllProfileNames (1)
; ImportProfile (3)
; RenameProfile (2)
; ResetProfile (1)
ExportProfile
Exports the active profile so it can be shared with other users.
Signature
object.ExportProfile Profile, RegFile
Object = The object or objects this property applies to, like PreferencesProfiles.
Profile = String; input-only. The name of the profile to be exported.
RegFile = String; input-only. The name of the file the profile will be exported to. The extension of the file should be .arg.
:)
-
(setq NewProfile1 (vlax-invoke-method acadprofiles1 'ExportProfile profilename1 profilepath1))
(2) arguments
Profile = String; input-only. The name of the profile to be exported.
RegFile = String; input-only. The name of the file the profile will be exported to. The extension of the file should be .arg.
THAT doesn't work... <headscratch.wav> :?
-
Are you passing the name of a valid (existing) profile and a valid path for the output?
-
:ugly:
I wasn't seeing that. Thanks MP, I've got something to work with now.
-
Are you sure it's not working? The call doesn't return anything unless it tosses a wobbly.
Check the target file of your export -- does it exist? Does the date / time stamp correlate?
-
Ya guud.
-
Task:
Multiple clients, each with their own standards, are a part of everyday business here. I'm giving the drafters the ability to click on a button and have the appropriate menus/support available with a profile. The problem is that when the user modifies this profile, and switches to a different client profile, then back again, the customization is lost. My solutioon is to start them out with a default, then they have the option to save it that way (through another button click) with their user login tacked on the end of the name of the default. When the user switches back to that client, the macro searhes for this profile, if not found, revert to default.
-
Sorry, typing...
Oh yeah, all guuud. Thanks again! :-)
-
Happy to help DeeGee ...
I do a similar thing, though I drive it all via a database front ended by a little vb app.
-
I'm not allowed to devote THAT much time to it, so I gotta get it done with minimal programming time. The last time I took on a database project, I spent 6 months. By the time my boss figured to ask me about it, I was too far into it to stop. I learned ALOT from that one. Sequel and Access are like fingernails on a blackboard to me to this day.
-
I know it has been awhile but:
(defun C:repair ()
(vla-exportprofile
(vla-get-profiles
(vla-get-preferences
(vlax-get-acad-object)
)
)
"MEP"
"C:\\_KTA MEP\\MEP.arg"
)
(princ "Updating Current Profile.....")
(print "Current Profile Update Complete.")
)
How would I rename the profile ?
I want to control updates to the registry reference by directing it to a profile in another location.
The only way to do it is to rename the current instance of that profile.
-
ok...duhhhhh :ugly:
(vla-renameprofile
(vla-get-profiles
(vla-get-preferences
(vlax-get-acad-object)
)
)
"MEP"
"MEP-Remove"
)
-
But I am missing where to set it current... time to do a search