Create a fairly simple Lisp for me please.

Create a fairly simple Lisp for me please.

carminatithekid1
Enthusiast Enthusiast
1,509 Views
20 Replies
Message 1 of 21

Create a fairly simple Lisp for me please.

carminatithekid1
Enthusiast
Enthusiast

I am looking to have someone create a fairly simple lisp for me.

 

I am wanting the lisp to allow me to select 2 points, draw a line between those 2 points and I want the line to offset 3" for a 1/4" scale drawing and 6" for an 8th scale drawing. Basically I want the offset to be based upon the dimscale.

I will want the line to be put on a specific layer "MP-NOTE".

I will also want a "DOT" placed at each end of the line. My office already have a lisp for creating this "DOT" and it is called "SPOT"

 

Please and thank you. I know this is simple but I am not educated enough in lisp to build this myself.

 

below is the lisp for "SPOT"

 

;program to build closed donuts in AutoCAD with reference to Dimscale
(defun c:spot (/ dscale spot_od spot_loc) ;start defun, define local variables
(setq dscale (getvar "dimscale")) ;set dscale to current dimscale
(setq spot_od 0.05) ;set dot diameter to .05
(setq spot_od (* dscale spot_od)) ;adjust dot diameter for drawings scale
(repeat 20 ;start repeat
(setq spot_loc (getpoint "\nCenter of doughnut: ")) ;get center of dot
(command ;start command
"laymcur" spot_loc ;change layer to object found at dot center point
"donut" "0" spot_od spot_loc "" ;draw spot
) ;end command
) ;end repeat
(princ) ;quiet exit
) ;end defun

Randy Carminati
0 Likes
1,510 Views
20 Replies
Replies (20)
Message 21 of 21

carminatithekid1
Enthusiast
Enthusiast
Yes, this is getting me closer. I will try my best to modify this to get to the actual finished product.
I do like the offset and appreciate you sending this to me.
Randy Carminati
0 Likes