Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Fatal Error: Commands may not be nested more than 4 deep"

Status
Not open for further replies.

ercegs

Mechanical
Jun 26, 2007
69
Hi...I'm creating a lISP file which will do something in 3d... When I load my lisp and start it, I must enter desired data in dialog box, and when I click OK it draws for me a 3d MODEL....now...this 3d model needs to be 3dmirrored...arrayed....etc...but I'm coming up to the following problem...Each time lisp draws for me this model this command 3dmirror remains active (this can be checked if you type cmdnames in autocad's command line). And when I start my dialog box for three times I get an error message like this:

"Fatal Error: Commands may not be nested more than 4 deep"

and my acad crashes. For some reason only this command remains active and I don't know how to shut it off???? Can anyone help me on this?

If I omit this command from my lisp file, and if I create a new lisp to do only mirror, then everything is OK...but this is not a solution?

Is there any chance to deactivate this command when my model is drawn?

Thanks in advance...
 
Replies continue below

Recommended for you

Hi ercegs,

It's been a while since I've done any LISP, but it sounds like you may not be exiting one of the other commands properly - meaning you may have missed a command prompt, or accidentally added and extra return and caused the command to repeat. Check it and if that's not it, post your code and I'm sure we can help you figure it out...

HTH
Todd
 
Here is a part of my code...I can't put it all..but this is the problematic part.

I'm trying all day today to solve this problem...but I can't.

Problem is whenever I called mirror3d command..and any other command after that (like move in this example)..mirror3d became written in CMDNAMES...and that is the problem..I tried to create separate function only for mirror3d but wont work.

So, I can call mirror3d just for one time..

I'm desperate..
 
 http://files.engineering.com/getfile.aspx?folder=a4dfde6b-4529-4f95-90f3-9c63ef505ba4&file=Mirror3D.pdf
Hi ercegs,

IIRC, mirror3d is an external program - you need to call it this way:
(mirror3D ....
not
(command "mirror3D" ...

HTH
Todd
 
Sorry to annoy, but here is my new code...Pay no attention on extra commands for arraying...I had to do that...but I've changed this mirror, and now looks like this in attach...But when program comes to that point it stops and I get this message:

; error: no function definition: MIRROR3D

Am I doing something wrong again??

Thanks
 
 http://files.engineering.com/getfile.aspx?folder=8f01cd23-1b31-4f96-a0ee-0b4964db924b&file=Mirror3D_new.pdf
Hi ercegs,

Nope, it just means you need to be sure it's loaded before you call it. When you run it from the command line, it's demand loaded, but when you call it from your routine, it's just trying to execute it - I think Acad.lsp (I know it's probably something different now) has some pretty good examples of how to check if a routine is loaded or not...

HTH
Todd
 
After spending a lot of times for this I finally solved this.

There are couple of things to say here, if someone need this also.

1. When you have external function like this mirror3d you must call it like this (mirror3d....) and not like this (command "mirror3d")...

2. THIS IS THE MOST IMPORTANT... before you do anything you must load file that contains your function. In my case, mirror3d is a part of GEOM3D.ARX file....so,my lisp wasn't working because I didn't load this arx file...When I put in my lisp code this line (arxload "geom3d") everything was ok..

Maybe this can be helpful for someone to know.

Regards, and thank you
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor