where is the command ZC defined?

where is the command ZC defined?

lleahyT4TGR
Community Visitor Community Visitor
497 Views
13 Replies
Message 1 of 14

where is the command ZC defined?

lleahyT4TGR
Community Visitor
Community Visitor

where is the command ZC defined? It does zoom center but i can't find it in the PGP, or CUI. I have a new shortcut that does not get defined on load, but if i reload the lisp after the drawing has been loaded. new definition works. 

0 Likes
498 Views
13 Replies
Replies (13)
Message 2 of 14

jreidKVSUZ
Collaborator
Collaborator

T4TGR,

 

Type at the command line:  APPLOAD  Then CONTENTS (right side 3/4 down)  (see attached image)

See if there are any startup settings that might be there at Start Up.

Hope this helps!!

 

Thanks, JRR!

 

APPLOAD SETTINGS.jpg

0 Likes
Message 3 of 14

Kent1Cooper
Consultant
Consultant

Put its definition [or, if it has its own file defining it, the (load)ing of that file] into acaddoc.lsp, and it will be loaded into every drawing you open or start.  I prefer that to the Startup Suite, for reasons that you can find discussed ad nauseam with some Searching.  Read about available approaches to automatic loading >here<.

[But this is one where the shortcut of defining such a command is not very much shortened.  If you don't mind one little extra keystroke, you can do without the ZC command and whether it is loading or gets overwritten -- just type Z and the spacebar and then C.]

Kent Cooper, AIA
Message 4 of 14

chriscowgill7373
Mentor
Mentor

If you have a preexisting ZC command that you are trying to redefine.  ZC is not a core command. Which means it is being loaded from somewhere.  If you have a ZC function that you have loading in your startup, but it doesnt work, unless you manually load it, it could be any number of reasons it isnt loading, or it could be being overwritten by the ZC.  I would suggest changing your call.  If it works, then it is being loaded, but overwritten.  If it doenst work, it isnt being loaded at all.  The whole point is, if it isnt working, tracking down why it isnt loading will be a lot more involved than fixing how it is being overwritten.


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2026 on Windows 11

Please select the Accept as Solution button if my post solves your issue or answers your question.

Message 5 of 14

beaufordt
Participant
Participant

The c3d.mnl file is a special AutoLISP file loaded automatically with Civil 3D, primarily defining specialized shortcuts and aliases rather than a standard list of commands. Key shortcuts often defined within it include ZC (Zoom Center), ZE (Zoom Extents) and ZA (Zoom All).

 

I'm guessing you're using Civil 3D or have had that lisp added.

0 Likes
Message 6 of 14

SAHMADDLPMY
Explorer
Explorer

lleahyT4TGR,

 

There is no built in ZC command in AutoCAD as mentioned by  chriscowgill7373.

You'll be required to create your own custom commands with "acaddoc.lsp" method as mentioned by  Kent1Cooper.

Here are the steps to follow;

Step-1 Create a file in notepad or notepad++ 

Step-2 Put your custom command code in the file as follow for Zoom Extent and Zoom Center ;

;;Command Shortcuts

;;Zoom Command

;;Zoom Extent

(defun c:ZE () (command "_.zoom" "_e") (princ))

;; Zoom Centre

(defun c:ZC () (command "_.zoom" "_c") (princ))

Step-3 Save the file as "acaddoc.lsp" to your AutoCAD Support Paths.

You can either put the file in below support paths or add in the startup suite or you can define your custom support path.

 Default Path is : C:\Program Files\Autodesk\AutoCAD 20xx\Support

 User Profile Path: C:\Users\<loginname>\AppData\Roaming\Autodesk\AutoCAD 20xx\Rxx.x\enu\Support

Step-4 Now you can run your own custom commands.

Hope this helps 😊

 

0 Likes
Message 7 of 14

Kent1Cooper
Consultant
Consultant

@SAHMADDLPMY wrote:

....

;;Zoom Extent

(defun c:ZE () (command "_.zoom" "_e") (princ))

....


A little suggestion....

This is what I use, because it can be transparent while in another command, which ZOOM Extents cannot be because it REGENerates the drawing.

(defun C:ZE (); Zoom Extents
  (if (> (getvar 'cmdactive) 0)
    (command "_.'zoom" (getvar 'extmin) (getvar 'extmax)); Zoom E Regens - can't be transparent
    (command "_.zoom" "_extents"); else [to reset EXTMIN/EXTMAX if appropriate]
  ); if
  (prin1)
)

To use while in another command, type it in with the transparent-use asterisk prefix: 'ZE.

Kent Cooper, AIA
Message 8 of 14

lleahyT4TGR
Community Visitor
Community Visitor

I think i need to clarify the post. When i open civil3d, there is a command defined for ZC that is a zoom center command. There is nothing in the appload, nothing in the acaddoc.lsp or anything being loaded. I am trying to hunt down the defining of this because i want to have a new defined command for ZC. I have the new command defined in the acaddoc.lsp and somewhere it goes overwritten when acad loads. But if i reload the acaddoc.lsp after autocad opens it does defined the new ZC command. I am curious what is defining it after loading the acaddoc.lsp loads and before beginning of the session?

 

0 Likes
Message 9 of 14

DGCSCAD
Collaborator
Collaborator

I'd search all files located in the support path for any file containing "zoom", or "ZC".

AutoCad 2018 (full)
Win 11 Pro
0 Likes
Message 10 of 14

Kent1Cooper
Consultant
Consultant

@lleahyT4TGR wrote:

.... I am curious what is defining it after loading the acaddoc.lsp loads and before beginning of the session?


Look into the S::STARTUP function, which can run things after the drawing is fully initialized, which is not true of acaddoc.lsp.  Maybe the specialty Civil3D version is happening after acaddoc.lsp has run, in which case [I hope] the S::STARTUP thing could then override that.  I can't seem to find documentation for it in Acad2026 or 2027 Help, but >here< it is in an older version.  [I hope that doesn't mean it no longer exists in newer versions.]

EDIT:

Found it in 2026 Help [before I saw @SAHMADDLPMY's link], >here<.  It's the same in 2027.

Kent Cooper, AIA
Message 11 of 14

beaufordt
Participant
Participant

When a CUI file loads it automatically load the menu lisp (*.mnl) file of the same name in the same support folder. Since the name is the same with a different extension sorted by name they should be right next to each other unless *.mnl files are hidden in File Explorer. c3d.mnl and civil.mnl undocumented command shortcuts 

This topic is mostly to document that apparently the factory versions of c3d.mnl and civil.mnl contain apparently undocumented definitions of the following shortcuts:

c:za
c:zc
c:zd
c:ze
c:zf
c:zi
c:zl
c:zm
c:zo
c:zp
c:zw
c:lll
c:xclipframetoggle

0 Likes
Message 12 of 14

SAHMADDLPMY
Explorer
Explorer

@lleahyT4TGR 

 

I ran into the same situation for ACADE where my function worked fine when loaded separately into drawing but when I define the same function in the "acaddoc.lsp" it's overwritten by other loading programs and i had to load it again to run, for the workaround i defined the function in a separate lisp file and then loaded it from acaddoc.lsp, which ran perfectly for me.

 

@Kent1Cooper 

Related to S::STARTUP the documentation is >here< for Acad2026, have'nt moved to 2027 yet 😎

 

0 Likes
Message 13 of 14

Sea-Haven
Mentor
Mentor

You could go for a custom lisp for zoom Center, say type Z100, Z55, z plus basically any number. and it will ask for a point, it looks at the Z for zoom and the number for the scale breaking apart what you have typed. If you have a look at the attached code you could add the Zoom C function. Yes you would need to preload the lisp so it is ready for use.

0 Likes
Message 14 of 14

chriscowgill7373
Mentor
Mentor

https://www.cadnauseam.com/2008/09/01/what-is-loaded-at-autocad-startup-and-when/

check this out for the order things load.  As you have provided, you are using Civil 3D, and the ZC is probably defined in the mnl file.

acaddoc.lsp is loaded before the mnl file, so that would explain that, however, as pointed out above if you define a s::Startup function it should be the very last thing loaded.


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2026 on Windows 11

Please select the Accept as Solution button if my post solves your issue or answers your question.