Lisp Routine for loading Custom dictionary each open drawing.

Lisp Routine for loading Custom dictionary each open drawing.

mikeshick
Collaborator Collaborator
3,445 Views
25 Replies
Message 1 of 26

Lisp Routine for loading Custom dictionary each open drawing.

mikeshick
Collaborator
Collaborator

Anyone know lisp for loading custom dictionary into acadYEARdoc.lsp.  My custom dictionary does not load for many years on several computers for several versions, which affects my spell check.  Once I open the spell check, and manually select the dictionary, it stays active for the open session...but reverts back to not seeing it.  

 

Thank you.

Mike Shick
www.medesigns.us
0 Likes
3,446 Views
25 Replies
Replies (25)
Message 2 of 26

cadffm
Consultant
Consultant

sysvar dctcust

😉

 

Sebastian

0 Likes
Message 3 of 26

SeeMSixty7
Advisor
Advisor

You should probably stick to just the ACADDOC.LSP instead of the ACADDOCYYYY.doc file. From what I understand that file is specifically meant for AutoCAD's use.

 

Good luck,

 

Clint

0 Likes
Message 4 of 26

mikeshick
Collaborator
Collaborator

Forgive me.  Could you elaborate.  I don't know lisp at all, except modify other routines to put my own variables for running them, or switching their variable references.

 

Thanks,

Mike Shick
www.medesigns.us
0 Likes
Message 5 of 26

mikeshick
Collaborator
Collaborator

I could be wrong, but I don't think acaddoc.lsp exists any more. I've only used AcadYYYYdoc.lsp for years without problem.

Mike Shick
www.medesigns.us
0 Likes
Message 6 of 26

SeeMSixty7
Advisor
Advisor

ACADDOC is loaded into every Dwg file at load. the ACADDOCyyyy.lsp file is for Autodesk's use of making any updates or compensation for specific versions of AutoCAD. It also means that when you update you don't have to update another file.

 

Take a look here. This is a bit dated, but the concepts the same.

 

https://knowledge.autodesk.com/support/autocad/troubleshooting/caas/sfdcarticles/sfdcarticles/Compar...

 

Good luck,

0 Likes
Message 7 of 26

mikeshick
Collaborator
Collaborator
Can I store the acaddoc.lsp file anywhere as long as I add the support path?
Mike Shick
www.medesigns.us
0 Likes
Message 8 of 26

SeeMSixty7
Advisor
Advisor

Yes you can. It is important to make sure it is high enough up so that it finds the one you want.

 

Find where it currently is if it exists. You can use the following at the AutoCAD Command prompt

(findfile "ACADDOC.LSP")

It will return the full path of the file it finds. It will search the paths listed in the ACAD path variable.

 

If it does not exist it will return nil. That means create one in whichever path you feel works best.

 

Good luck,

0 Likes
Message 9 of 26

mikeshick
Collaborator
Collaborator
Thanks. Now, any more help on the rest of the lsp code for loading that dictionary file? When I open the spell checker, my dictionary shows up, but it's never selected, even though I specify it as default. Thus, every time I spell words not in the AutoCAD dictionary, they show misspelled until I manually load my custom dictionary.
Mike Shick
www.medesigns.us
0 Likes
Message 10 of 26

SeeMSixty7
Advisor
Advisor

As @cadffm suggested set the dctcust variable.

 

(setvar "dctcust" "yourdictionaryhere")

 

I'm assuming your dictionary is on the acad path and all you need to provide is the file name.

 

Good luck,

 

Message 11 of 26

mikeshick
Collaborator
Collaborator
Thank you. Just wasn't sure what to do with the rest of it. Got it from here, I suppose.

Thanks,
Mike Shick
www.medesigns.us
Message 12 of 26

mikeshick
Collaborator
Collaborator

So, I set my custom dictionary, but I my custom dictionary still requires manual selection to work. Any other ideas?

Mike Shick
www.medesigns.us
0 Likes
Message 13 of 26

cadffm
Consultant
Consultant
This dialog is only important for us if you show us your exact (setvar ".....) statement and the image of the entries in the options / files / Texteditor ... / Custom..Dictionary


Or the Value of DCTCUST (getvar "DCTCUST").
We can not see your input and not all Acad Current Values.

We can only say: If you do it right, then it works.
We can not see a mistake if you do not show what you're doing.

Without Lisp, you attached The File to the Options/Files/.. See above
Then select and set active[Button on the right side]

Now, there is a arrow left from the path, not a point.
(if you using DCTCUST, perhaps no Arrow appear, but it still works too)

Sebastian

0 Likes
Message 14 of 26

Ranjit_Singh
Advisor
Advisor

The default values are stored in registry

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R20.0\ACAD-E000:409\Profiles\xxxxxx\Editor Configuration\MainDictionary]

[HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R20.0\ACAD-E000:409\Profiles\xxxxxx\Editor Configuration\CustomDictionary]

However, you will have to change them outside of AutoCAD (while no AutoCAD session is active) to make the changes programmatically. While inside AutoCAD, only way to change it is through the AutoCAD Check Speling GUI.

 

0 Likes
Message 15 of 26

cadffm
Consultant
Consultant

"While inside AutoCAD, only way to change it is through the AutoCAD Check Speling GUI."

UI works as well, as already described several times

 


Type it ine the commandline, or
Script
command
commandsend
shortcut..

 

commaand
DCTCUST
D:\\brandnew.cus

SETENV

DCTCUST

D:\\brandnew.cus

(setvar "DCTCUST" "D:\\brandnew.cus")

 

_vbastmt: Thisdrawing.setvariable "DCTCUST", "D:/brandnew.CUS"

 

 

 

 

 

Sebastian

0 Likes
Message 16 of 26

mikeshick
Collaborator
Collaborator
Sorry, fellows. I don't completely understand the comments made.

Here is my acaddoc.lsp

(setvar "dctcust" "Mikes Dict")

Command: (GETvar "dctcust")
"Mikes Dict"

Here are some pictures that show the variable is set, however it still seems as though my custom dictionary is not active, and words that I spell that are in that dictionary still come out incorrect.

Does this clarify the problem?
Mike Shick
www.medesigns.us
0 Likes
Message 17 of 26

cadffm
Consultant
Consultant

If you add a user dictionary via the GUI (Options / Files / Texteditor ...)
Then you see that AutoCAD saves the PATH + file name + extension.

DCTCUST or (getvar "DCTCUST") then provides the corresponding path along with the complete path.

Please enter the full path + filename + file extension.

(Setvar "DCTCUST" "D:\\MiksPath\\Mikes Dict.cus")
or
(If (setq MyCUS (findFile "Mikes Dict.cus")) (setvar "DCTCUST" MyCUS) (princ "\nCUS lost in Space"))

I hope it helps.

Sebastian

Message 18 of 26

mikeshick
Collaborator
Collaborator
Do I include the spaces as typed here:

(Setvar "DCTCUST" "S: \\ CAD \\ SUPPORT \\ DICTIONARY \\ Mikes Dict.cus")

MIKE SHICK
Mike Shick
www.medesigns.us
0 Likes
Message 19 of 26

mikeshick
Collaborator
Collaborator

I found the problem.  Under options, files, dictionary, cutom dictionary, I need to hit the set current button.  I have not seen that for many versions!  Uh!!!!!

Mike Shick
www.medesigns.us
Message 20 of 26

cadffm
Consultant
Consultant

 05-04-2017 11:22 PM
"Without Lisp, you attached The File to the Options/Files/.. See above
Then select and set active[Button on the right side]"

 

Thats the normal way thrue the GUI, yes. Smiley Happy

Sebastian

0 Likes