Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ERROR while runnung prog in autocad

3 REPLIES 3
Reply
Message 1 of 4
vanshkande
592 Views, 3 Replies

ERROR while runnung prog in autocad

I wrote following prof to construct a simple rectangle and i am getting error as mentioned below. Please help me out and suggest me to resolve this error.

 

(defun c:retan (/ pl p2 p3 p4)
(setq pl (getpoint "\nfirst corner of rectangle: "))
(setq p3 (getcorner "\nsecond corner of rectangle: "))
(setq p2 (list (car pl)(cadr p3)))
(setq p4 (list (car p3)(cadr pl)))
(command "line" pl p2 p3 p4 "c")
(princ)
)

 

ERROR: Base point required.

 

 

I selected the base point but then to i am gettting this error.

3 REPLIES 3
Message 2 of 4
_Tharwat
in reply to: vanshkande

 (setq p3 (getcorner "\nsecond corner of rectangle: " pl))

 

Also to put off osnap while drawing lines .

 

(command "line" "_non" pl "_non" p2 "_non" p3 "_non" p4 "c")

Message 3 of 4
paullimapa
in reply to: vanshkande

you are missing a point parameter on the getcorner function.

That line should read:

(setq p3 (getcorner pl "\nsecond corner of rectangle: "))

 

And in case the LINE command has been redefined, you should precede the command with a period:

(command ".line" pl p2 p3 p4 "c")

 

Area Object Link | Dwg Setup | Feet-Inch Calculator
Exchange App Store


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 4 of 4
Kent1Cooper
in reply to: vanshkande

You could, if you choose, avoid the issue by taking a different approach, with no variables and no calculations of other corners:

 

(command "_.rectang" pause pause "_.explode" "_last")

 

Or, if you ever use the Fillet/Chamfer options in the Rectang command, and such a thing might be set, force it to have square corners.  You might also need to account for the possibility of the Thickness option if you ever use that.  The Width option doesn't matter in the end, because that will be lost in Exploding it, but you might want to fix that if it's a possibility, just for the sake of the appearance while drawing it:

 

(command "_.rectang" "_fillet" 0 "_thickness" 0 "_width" 0 pause pause "_.explode" "_last")

Kent Cooper, AIA

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost