Jump to content

Recommended Posts

Posted

The two codes below have been used by my office since before i started working here. They've worked fine in the past and today they decided to stop. I get this error for the first one:

Command: sa

Pick insertion point:

Angle?:

; error: An error has occurred inside the *error* functiontoo many arguments

; error: An error has occurred inside the *error* functiontoo many arguments

Unknown command "SA". Press F1 for help.

and this error for the second one:

Command: 4SA

NPICK POINT; error: An error has occurred inside the *error* functiontoo many

arguments

; error: An error has occurred inside the *error* functiontoo many arguments

Unknown command "SA". Press F1 for help.

Unknown command "@15,0". Press F1 for help.

48.000000

LISP command is not available.

48.000000

(yes they are both loaded i double and triple checked that)

 inserts air direction arrow (supply)
(defun c:sa ()
(setq ortho (getvar "orthomode"))
(setq scl (getvar "dimscale" ))
(setvar "orthomode" 1)
(setq pnt (getpoint "\nPick insertion point:" ))
(setq a (getangle "\nAngle?:" pnt ))(terpri) 
(setq ang ( * a 57.3))
(command "layer" "set" "txt" "")
(command "insert" "sa" pnt scl scl ang) 
)

 

 inserts 4 way air direction arrows for diffuser
(defun c:4sa ()
(SETVAR "OSMODE" 64)
(SETQ INS (GETPOINT "\NPICK POINT"))
(COMMAND "ID" INS)
(setvar "clayer" "txt")
(setq scl (getvar "dimscale" ))
(command "insert" "sa" "@15,0" scl scl 0)
(COMMAND "ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
(SETVAR "OSMODE" 0)
)

Posted
The two codes below have been used by my office since before i started working here. They've worked fine in the past and today they decided to stop. I get this error for the first one:

Command: sa

Pick insertion point:

Angle?:

; error: An error has occurred inside the *error* functiontoo many arguments

; error: An error has occurred inside the *error* functiontoo many arguments

Unknown command "SA". Press F1 for help.

and this error for the second one:

Command: 4SA

NPICK POINT; error: An error has occurred inside the *error* functiontoo many

arguments

; error: An error has occurred inside the *error* functiontoo many arguments

Unknown command "SA". Press F1 for help.

Unknown command "@15,0". Press F1 for help.

48.000000

LISP command is not available.

48.000000

(yes they are both loaded i double and triple checked that)

 inserts air direction arrow (supply)
(defun c:sa ()
(setq ortho (getvar "orthomode"))
(setq scl (getvar "dimscale" ))
(setvar "orthomode" 1)
(setq pnt (getpoint "\nPick insertion point:" ))
(setq a (getangle "\nAngle?:" pnt ))(terpri) 
(setq ang ( * a 57.3))
(command "layer" "set" "txt" "")
(command "insert" "sa" pnt scl scl ang) 
)

 

 inserts 4 way air direction arrows for diffuser
(defun c:4sa ()
(SETVAR "OSMODE" 64)
(SETQ INS (GETPOINT "\NPICK POINT"))
(COMMAND "ID" INS)
(setvar "clayer" "txt")
(setq scl (getvar "dimscale" ))
(command "insert" "sa" "@15,0" scl scl 0)
(COMMAND "ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
(SETVAR "OSMODE" 0)
)

chelsea1307,

 

See code below.

Its looking for a layer call txt.

I added a layer command to make the layer if its not in the drawing.

Also be sure the block call sa is in the acad search path.

If you have these layers in the drawing already then skip this.

 

Other than that they seem to work. I did not get the error you are referring to.

 

It may be possible since the variables in the programs are not declared local and

may be interferring with another program that may be loaded.

Just a guess.

 

;inserts air direction arrow (supply)
(defun c:sa ()
(setq ortho (getvar "orthomode"))
(setq scl (getvar "dimscale" ))
(setvar "orthomode" 1)
(command "_-layer" "_make" "txt" "")    ;I added this line
(setq pnt (getpoint "\nPick insertion point:" ))
(setq a (getangle "\nAngle?:" pnt ))(terpri) 
(setq ang ( * a 57.3))
(command "_-layer" "_set" "txt" "")
(command "_-insert" "sa" pnt scl scl ang) ;Make sure this block is in the acad path
)

 

 

 

;inserts 4 way air direction arrows for diffuser
(defun c:4sa ()
(SETVAR "OSMODE" 64)
(SETQ INS (GETPOINT "\nPICK POINT"))
(COMMAND "ID" INS)
(command "_-layer" "_make" "txt" "")  ;I added this line
(setvar "clayer" "txt")
(setq scl (getvar "dimscale" ))
(command "_-insert" "sa" "@15,0" scl scl 0)  ;Make sure this block is in the acad path
(COMMAND "_ARRAY" "LAST" "" "POLAR" "@-15,0" "4" "" "" )
(SETVAR "OSMODE" 0)
)

Posted

As you do not seem to be defining an error handler in your functions, the error within the *error* function message would be caused by a badly written *error* handler.

 

Type this at the command line and try re-running your original lisps:

 

(setq *error* nil)

Posted

thanks buzzard i will try what you put,

Lee, should i add that to the lisps? or just check to see if they work after that?

Posted
thanks buzzard i will try what you put,

Lee, should i add that to the lisps? or just check to see if they work after that?

 

chelsea1307,

 

As Lee mentioned, Run that at the command prompt. Its to clear the error handler. Then run your programs again after you have cleared it.

Posted
... Type this at the command line and try re-running your original lisps...

 

^^^ o:) ^^^

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...