AIberto Posted September 7, 2014 Share Posted September 7, 2014 (edited) Hi dear friend. look: 1 step. pick a line (or pline) ,Enter the Offset distance. 2 step. pick a line (or pline) ,Enter the Offset distance. 3 step. draw a circle with center line ,the layer name of center line is "cen" 4 step. Choose inside or outside many thanks ! Edited September 7, 2014 by AIberto Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 7, 2014 Share Posted September 7, 2014 Haven't we just written that program? http://www.cadtutor.net/forum/showthread.php?88556-Draw-circle-with-polygon Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 7, 2014 Author Share Posted September 7, 2014 Haven't we just written that program? http://www.cadtutor.net/forum/showthread.php?88556-Draw-circle-with-polygon Sorry! lee I just test your code, very good! many thanks!!! can help me with this thread. thanks again. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 7, 2014 Share Posted September 7, 2014 I can not see any difference between this thread and the previous one ? Quote Link to comment Share on other sites More sharing options...
pBe Posted September 8, 2014 Share Posted September 8, 2014 I'm guessing what the OP is wanting is "pick a corner" and create the "thingy" for that corner alone. [hang on. i could be wrong > Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 8, 2014 Author Share Posted September 8, 2014 I can not see any difference between this thread and the previous one ? Tharwat. It's difference . Not necessarily closed object , Not necessarily a polygon. Not the same Offset distance .(d1 &d2), Need two pick , (pick1 & pick2) Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 9, 2014 Author Share Posted September 9, 2014 This is only draw a circle. when draw complete . don't exit. Can be draw the next one . until press the "ESC" key. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 (edited) Try this Alberto and let me know . (defun c:Test (/ _line _screw s1 s2 l a p) ;; Author: Tharwat ;; ;; Date: 09.09.2014 ;; (defun _line (p q) (entmakex (list '(0 . "LINE") (cons 8 "cen") (cons 62 4) (cons 10 p) (cons 11 q))) ) (defun _screw (pt r) (mapcar '(lambda (p) (entmakex (list '(0 . "CIRCLE") (cons 10 p) (cons 40 r))) (_line (polar p 0. (* r 1.2)) (polar p pi (* r 1.2))) (_line (polar p (* pi 1.5) (* r 1.2)) (polar p (* pi 0.5) (* r 1.2))) ) (list pt) ) ) (while (and (setq s1 (entsel "\n Pick Left side line :")) (wcmatch (cdr (assoc 0 (entget (car s1)))) "LINE,LWPOLYLINE") (setq s2 (entsel "\n Pick Right side line :")) (wcmatch (cdr (assoc 0 (entget (car s2)))) "LINE,LWPOLYLINE") (setq p (getpoint "\n Specify Corner point of the two side [intersection] :")) (setq *dist1* (cond ((getdist (strcat "\n Specify Left distance < " (rtos (if *dist1* *dist1* (setq *dist1* 1.0) ) 2 2 ) " > :" ) ) ) (*dist1*) ) ) (setq *dist2* (cond ((getdist (strcat "\n Specify Right distance < " (rtos (if *dist2* *dist2* (setq *dist2* 1.0) ) 2 2 ) " > :" ) ) ) (*dist2*) ) ) (setq *rad* (cond ((getdist (strcat "\n Diameter of Circle < " (rtos (if *rad* *rad* (setq *rad* 1.0) ) 2 2 ) " > :" ) ) ) (*rad*) ) ) ) (progn (setq l (mapcar 'vlax-curve-getclosestpointto (list (car s1) (car s2)) (list (cadr s1) (cadr s2))) a (mapcar 'angle (list p p) (list (car l) (cadr l))) ) (_screw (polar (polar p (car a) *dist2*) (cadr a) *dist1*) (/ *rad* 2.)) ) ) (princ) )(vl-load-com) Edited September 9, 2014 by Tharwat Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 9, 2014 Author Share Posted September 9, 2014 Try this Alberto and let me know . NOTE: I have highlighted in Blue the radius of circle in the routine , so you can change it to suit your needs if you want to . Thanks very much ! Tharwat. I am so sorry! sorry! I didn't say clear . I want Enter radius of circle by routine ,Rather than a fixed value. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 Thanks very much ! Tharwat. I am so sorry! sorry! I didn't say clear . I want Enter radius of circle by routine ,Rather than a fixed value. Not a problem , I modified the routine , try and let me know . NOTE: if you want to cancel the process of the program , just hit Enter or the space bar which is better than Esc button and to avoid error message . Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 9, 2014 Author Share Posted September 9, 2014 Not a problem , I modified the routine , try and let me know . NOTE: if you want to cancel the process of the program , just hit Enter or the space bar which is better than Esc button and to avoid error message . Thank you !masters Tharwat. I have a small request . I need Enter the diameter of circle, not Radius. I need the layer of centre line is "cen" gradation can change ? 1.Pick left side line 2.Pick right side line 3.Specify a point on the Corner 4.Specify Left distance 5.Specify Right distance 7.Enter diameter of Circle Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 Thank you !masters Tharwat. I have a small request . I need Enter the diameter of circle, not Radius. I need the layer of centre line is "cen" gradation can change ? 1.Pick left side line 2.Pick right side line 3.Specify a point on the Corner 4.Specify Left distance 5.Specify Right distance 7.Enter diameter of Circle Modified again HERE. Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 9, 2014 Author Share Posted September 9, 2014 Modified again HERE. Thanks so much Tharwat. It's very nice! gooooood ! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 Thanks so much Tharwat.It's very nice! gooooood ! You are welcome . Quote Link to comment Share on other sites More sharing options...
highflybird Posted September 9, 2014 Share Posted September 9, 2014 Hello, Tharwat. Long time no see ! You are still so enthusiastic ! Good routine! A little advice . Why need specify intersection point ? Two line intersection point , Can't calculate? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 Hello, Tharwat. Long time no see ! You are still so enthusiastic ! Hi , I am here all the time , but you might be not enthusiastic to participate with us in here Why need specify intersection point ? Two line intersection point , Can't calculate? Okay , I made mine quickly at the first glance and it does not hurt with one more step from a user Eager to see your try in this regard . Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 This should work as you may have indicated to if the two objects are lines or polylines or then one polyline (setq p (vlax-invoke (vlax-ename->vla-object (car s1)) 'intersectwith (vlax-ename->vla-object (car s2)) Acextendboth)) Quote Link to comment Share on other sites More sharing options...
highflybird Posted September 9, 2014 Share Posted September 9, 2014 This should work as you may have indicated to if the two objects are lines or polylines or then one polyline (setq p (vlax-invoke (vlax-ename->vla-object (car s1)) 'intersectwith (vlax-ename->vla-object (car s2)) Acextendboth)) Haha, you know I don't understand programming ., Have a headache . Quote Link to comment Share on other sites More sharing options...
AIberto Posted September 9, 2014 Author Share Posted September 9, 2014 Why need specify intersection point ? Two line intersection point , Can't calculate? A good idea. thanks This should work as you may have indicated to if the two objects are lines or polylines or then one polyline (setq p (vlax-invoke (vlax-ename->vla-object (car s1)) 'intersectwith (vlax-ename->vla-object (car s2)) Acextendboth)) can be achieved ? Tharwat. can you modify it ? This can save a step . Thanks. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 9, 2014 Share Posted September 9, 2014 Haha, you know I don't understand programming ., Have a headache . Not a problem , I did not know before that the vla-intersectwith function can get the corner of two segments of a polyline , so that why I went that way as before , but now I have modified the routine with the new changes . A good idea. thanks can be achieved ? Tharwat. can you modify it ? This can save a step . Thanks. Already done Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.