Jump to content

Recommended Posts

Posted (edited)

hey Guys,

I am hoping someone can let me know what is incorrect about my approach here. I have created 2 routines:

IMP-CUI: which renames the old "acad.cuix" and bring in my updated one (do not ask why I did not use "vl-file-copy" method as the result was not satisfactory for me anyways).

2016N: which import the profile from a server location and renames the "...(US Metric)" first to then replace it with an updated one with the same name.

 

The result is quite random when I try it on different computers with the same version. Although I can see that the profile is imported, it does not always carry my setting. I keep losing my supported path, etc... each time I twick the routine.

 

My acad.cuix is updated and when I import it manually seems to have all of my options including the checked and unchecked boxes and supported files. I am tried of trying really! the funny thing is that my partial cuix menus load with no issue, but my preferences on option setting is random even on the same computer when I reset setting to default.

 

Can anyone help PLEASE!

Recently enough BIGAL was telling me something about .MNR or .MNL files but I have no idea how to process those.

 

Thanks,

Bother in need! hah!

(defun c:IMP-CUI ()
;;; FIND THE USER
(setq loginname (getvar "loginname"))
;;; RENAME THE ORIGINAL "acad.cuix" TO "acad_OLD.cuix"
(vl-cmdf "shell" (strcat "ren " "\"" (strcat "C:\\Users\\" (getvar "loginname") "\\AppData\\Roaming\\Autodesk\\ACA 2016\\enu\\Support\\acad.cuix") "\" \"" "acad_OLD.cuix" "\""))
;;; COPY THE UPDATED "acad.cuix" FROM SERVER ONTO SUPPORT FOLDER
(command "REGEN" "")  
(vl-cmdf "shell" (strcat "copy " "\"" "V:\\SALLE A DESSIN\\SAM - OUTILS XLS DWG\\3-LSP XLS\\AutoCAD-PROFILE-CUI MIGRATION\\2016\\acad.cuix" "\" \"" (strcat "C:\\Users\\" (getvar "loginname") "\\AppData\\Roaming\\Autodesk\\ACA 2016\\enu\\Support\\") "\""))
(vl-load-com)
(princ)
(command "_.close" "_N" "")  
); END DEFUN





(defun c:2016N ()  
;---------------------------------------------- PROFILE ----------------------------------------------;
  
;;; ALL PROFILES "Profilelst"
(setq Profilelst
	(vla-get-profiles
	(vla-get-preferences
	(vlax-get-Acad-Object)))
)
;;; "CurrentActive" TO STORE ACTIVE PROFILE
(setq CurrentActive
       (vla-get-ActiveProfile Profilelst)
)
;;; RENAME THE "CurrentActive" IF IT IS: "AutoCAD Architecture (US Metric)"
(if
(= CurrentActive "AutoCAD Architecture (US Metric)")
	(vlax-invoke-method
		Profilelst
		'RenameProfile
		CurrentActive
		"OLD_Profile")
)
;;; IMPORT PROFILE
(setq ImpProfile
	(vlax-invoke-method
		Profilelst
		'ImportProfile
		"AutoCAD Architecture (US Metric)"
		"V:\\SALLE A DESSIN\\SAM - OUTILS XLS DWG\\3-LSP XLS\\AutoCAD-PROFILE-CUI MIGRATION\\2016\\AutoCAD Architecture (US Metric).arg" 
		:vlax-true
	)
)
;;; SET "AutoCAD Architecture (US Metric)" AS ACTIVE PROFILE
	(vla-put-ActiveProfile
	  Profilelst
	  "AutoCAD Architecture (US Metric)"
	)
;;; RESET PROFILE
	(vlax-invoke-method
	  	Profilelst
		'ResetProfile
		"AutoCAD Architecture (US Metric)"
	)
;;; DELETE "AutoCAD Architecture (US Imperial)" IF EXIST
(repeat  
	(vlax-invoke-method
		Profilelst
		'DeleteProfile
		"AutoCAD Architecture (US Imperial)"
		"OLD_Profile"
		"AutoCAD"
	)
)
(vl-load-com)
(princ)  
); END DEFUN

I FOUND THAT IF I RESET THE PROFILE, IT MESSES UP WITH THE GENERAL SETTING AND REMOVES MAPPING FOR SUPPORTED PATHS!

RIGHT NOW WITHOUT THE RESET FUNCTION EVERYTHING SEEMS DANDY AFTER A COUPLE OF TRIES.

Edited by Sambuddy
TESTED AGAIN
Posted

It worked out!

So the only issue I had was resetting the profile which I should not have done.

And now Thanks to BIGAL's DCL, I have a very easy setup:

image.thumb.png.53f5177411f022d5f54d8dcd0a7cbe8e.png

@BIGAL is it possible for this to be in two or more rows, if yes, how SIR?

 

my next challenge is now to create a lisp for publishing > windows to select sheets > a button to select all sheets > select pen assignment > PDF or Printer > select page setup name

 

any ideas would be appreciated.

Posted

I have thought about 2 rows or columns, it becomes a bit more complicated but not impossible. Grrr or Rlx have written some multi box dcl's that may be a better way to go it would arrange in a grid pattern. Hopefully they will respond.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...