Jump to content

"chamfer" unknown command in lisp routine


cso

Recommended Posts

I have been trying to debug this and nothing I do seems to work. I am writing a simple routine to draw two lines and then a chamfer. It makes my lines but does not recognize the "chamfer" command. I tried "_.chamfer", as suggested on other forums but that doesn't work either. I was picking a distance of 1" for both distances. I know it isn't a pretty lisp program, but I just started this in class and it seems like it should work. Thanks

 

(defun C:chamfer2()

(setq p1 (getpoint "\n enter first point of line"))

(setq p2 (getpoint "\n enter second point of line"))

(setq p3 (getpoint "\n enter third point"))

(command "line" p1 p2 "")

(command "line" p1 p3 "")

(setq d1(getdist "\n get first chamfer distance"))

(setq d2 (getdist "\n get second chamfer dist"))

(setvar "chamfera" d1)

(setvar "chamferb" d2)

(command "chamfer" pause pause)

)

Link to comment
Share on other sites

I tried that again and it worked! I think I was using too large of a distance. Why do I have to use _.? What would cause a language compatibility issue? Thanks for your help.

Link to comment
Share on other sites

I tried that again and it worked! I think I was using too large of a distance. Why do I have to use _.? What would cause a language compatibility issue? Thanks for your help.

Is your native language English? Autodesk is an American company, thus everything is coded in English.

 

The "_" as a prefix to a command will take the original (English) command name.

The "." is to ignore if a command has been redefined. In this situation it isn't needed, but it's just a 'best practices' situation.

Link to comment
Share on other sites

Yes, it is English. I am using AutoCad Architecture 2011 Student version. Is there a way to tell if a command has been redefined? I have been working on a lot of lisp routines and practicing from different sources, maybe I changed something.

Link to comment
Share on other sites

Yes, it is English. I am using AutoCad Architecture 2011 Student version. Is there a way to tell if a command has been redefined? I have been working on a lot of lisp routines and practicing from different sources, maybe I changed something.

You can reset it by typing:

Command: redefine
Enter command name: chamfer

 

Some of the newer releases act a little odd if the "_." aren't added.

Link to comment
Share on other sites

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