Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Lisp question on LINE command 1

Status
Not open for further replies.

CADMILES

Mechanical
May 23, 2006
23
0
0
US
Does anyone know what the correct argument string should be to use the LINE command in a lisp program? I am using ACAD 2008. I am trying to use the angle override option after providing a first point, then I want to allow the user to select a screen point for the length. The code that I think should work, but doesn't:

(setq p1 (list 0 0 0))
(setq newang "<30.0")
(command ".LINE" p1 newang "" pause "")

Autocad seems to recognize the angle override, but then errors out. Any ideas?
 
Replies continue below

Recommended for you

I don't have 2008 but the "enter" after the 'newang' may be the problem-try deleting it so;

(command ".LINE" p1 newang pause "")


 
IFRs,
The newang var is defined as a string that contains "<" as the leading character. I have tried "<" followed by the angle, but that doesn't work either. I will try all suggestions. Thanks.
 
I find the "angle override" present in 2005 so I could play with it. I find also that "command" has problems with the override, but the following seems to work OK:

(vl-cmdf ".LINE" p1 newang pause "")
 
CarlB,
Yes, that fixes it. Looks like I need to read up on Visual Lisp. All my old code is pre-Visual and may need updating with changes like this one. You've saved me considerable searching. Thanks very much. I owe you one.
 
Status
Not open for further replies.
Back
Top