Jump to content
ayuksel

Direction of the arc

Recommended Posts

ayuksel

Hello,

 

I am trying to draw a solid object by AutoLISP. But I got stuck while drawing an arc.

 

Please see below picture where I got stuck.

 

yEXAVM.jpg

 

I need this arc parallel to the lines below it. I tried some UCS command but at that time arc shown up somewhere irrelevant. Couldn't figure it out. I'm doing something wrong. (I can post my .lsp here however it might be confusing for you as it contains many variables defined by me)

 

Can anybody help please?

Edited by ayuksel

Share this post


Link to post
Share on other sites
ReMark

I think it would be in your best interest to attach a copy of the lisp routine to your next post.

Share this post


Link to post
Share on other sites
ayuksel

Sorry, it's here:

 

(defun c:abd ()
       (setq wid1 60 len 115 wid1 60 wid2 22.5 hole1 20 hole2 15 rad1 22.5 rad2 20 rad3 50 rad4 10 rad5 7.5 he1 15 thi1 15 thi2 15 dist1 47.5 dist2 25 dist3 22.5 dist4 37.5)

;base
(setq pnt1 (getpoint "\nPlease select the starting point"))
(setq pnt2 (list (+ (car pnt1) (- len rad2))  (cadr pnt1)  (caddr pnt1))) 
(setq pnt3 (list (car pnt2) (- (cadr pnt2) (- wid1 (* rad1 2)))  (caddr pnt1)))
 (setq pnt4 (list (+ (car pnt3) (* rad2 2)) (cadr pnt3)  (caddr pnt1)))
(setq pnt5 (list (car pnt4) (+ (cadr pnt4) wid1)  (caddr pnt1)))
(setq pnt6 (list (- (car pnt4) (+ len rad2)) (cadr pnt5)  (caddr pnt1)))
(setq pnt7 (list (car pnt1) (cadr pnt1) (caddr pnt1)))

(command "line" "_non" pnt1 "_non" pnt2 "")
 (setq l1 (entlast))
 (command "line" "_non" pnt2 "_non" pnt3 "")
 (setq l2 (entlast))
(command "line" "_non" pnt3 "_non" pnt4 "")
 (setq l3 (entlast))
(command "line" "_non" pnt4 "_non" pnt5 "")
 (setq l4 (entlast))
(command "line" "_non" pnt5 "_non" pnt6 "")
 (setq l5 (entlast))
(command "line" "_non" pnt6 "_non" pnt7 "")
 (setq l6 (entlast))

 (setvar "filletrad" 10)
 (command "._fillet" l1 l2)
(setq f1 (entlast))
 (setvar "filletrad" 50)
 (command "._fillet" l4 l5)
(setq f2 (entlast))

 (command "._pedit" "_m" l1 l2 l3 l4 l5 l6 f1 f2 "" "_j" "0.00" "" "")

 (setq base (entlast))
(command "extrude" base "" he1 "")

(setq extbase1 (entlast))


   (setq pnt8 (list (+ (car pnt1) dist1) (+ (cadr pnt1) (- rad1 rad5))  (caddr pnt1)))
 (setq pnt9 (list (+ (car pnt1) (+ dist1 dist3)) (+ (cadr pnt1) (- rad1 rad5))  (caddr pnt1)))

 (command "line" "_non" pnt8 "_non" pnt9 "")

 (setq l7 (entlast))
   
(setq pnt10 (list (+ (car pnt1) dist1) (+ (cadr pnt1) (+ rad1 rad5))  (caddr pnt1)))
 (setq pnt11 (list (+ (car pnt1) (+ dist1 dist3)) (+ (cadr pnt1) (+ rad1 rad5))  (caddr pnt1)))


 (command "line" "_non" pnt10 "_non" pnt11 "")

 (setq l8 (entlast))

 (command "_.arc" "_non" pnt8 "_e" "_non" pnt10 "_direction" 180)

 (setq arc1 (entlast))

 (command "_.arc" "_non" pnt9 "_e" "_non" pnt11 "_direction" 0)
 
 (setq arc2 (entlast))

   (command "._pedit" "_m" l8 arc1 l7 arc2 "" "_j" "0.00" "" "")
 
(setq excut (entlast))

 (command "extrude" excut "" he1 "")

 (setq extcuta (entlast))

 (command "subtract" extbase1 "" extcuta "")

 (setq extbasenew (entlast))
 
(setq pnt12 (list (car pnt1) (cadr pnt1) (+ (caddr pnt1) he1)))
(setq pnt13 (list (car pnt1) (cadr pnt1) (+ (caddr pnt1) (+ dist2 he1))))
(command "_.line" "_non" pnt12 "_non" pnt13 "")
(setq l9 (entlast))

(setq pnt14 (list (car pnt1) (+ (cadr pnt1) (* rad1 2)) (+ (caddr pnt1) he1)))
(setq pnt15 (list (car pnt1) (+ (cadr pnt1) (* rad1 2)) (+ (caddr pnt1) (+ dist2 he1))))
(command "_.line" "_non" pnt14 "_non" pnt15 "")
(setq l10 (entlast))


 



 
 (command "_.arc" "_non" pnt13 "_e" "_non" pnt15 "_radius" rad1)


 
 (setq arc3 (entlast))

 )

Edited by ayuksel

Share this post


Link to post
Share on other sites
ReMark

Is this an assignment for school to write a lisp program to create the above pictured object?

Share this post


Link to post
Share on other sites
ayuksel

Yes, this is an assignment I need to complete soon :( . I write a LISP to draw the object and the default dimensions must be modified by using a dialog window (Dialog Control Language code).

Share this post


Link to post
Share on other sites
Roy_043

If you have a problem changing the UCS you can try to create and extrude the entities in the WCS and then use the Rotate3D command to correctly position the solids. I would also suggest starting with polylines instead of arcs and lines.

Share this post


Link to post
Share on other sites
ayuksel
If you have a problem changing the UCS you can try to create and extrude the entities in the WCS and then use the Rotate3D command to correctly position the solids. I would also suggest starting with polylines instead of arcs and lines.

 

Is it possible to extrude a sketch without joining it?

 

I tried polyline and couldn't manage it as well :( .

 

This project drove me crazy!

Share this post


Link to post
Share on other sites
ayuksel
If you have a problem changing the UCS you can try to create and extrude the entities in the WCS and then use the Rotate3D command to correctly position the solids. I would also suggest starting with polylines instead of arcs and lines.

 

You save my ass by telling rotate3d!

 

Thanks a lot!

Edited by ayuksel
situations changed

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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