Lee Chu Chu Posted February 11, 2015 Share Posted February 11, 2015 I want a lisp that when two lines are inserted and they intersect each other at 90 degrees, I want them to create a chamfer Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 12, 2015 Share Posted February 12, 2015 Why not have a go at writing something yourself Cadtutor is not a I WANT I WANT service. We can help when you get stuck. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted February 12, 2015 Share Posted February 12, 2015 Why not have a go at writing something yourself Cadtutor is not a I WANT I WANT service. We can help when you get stuck. Well said Bigal Besides that , they don't even take a few seconds to reply to their own threads ( recent one HERE ) , and this conduct is really terrible and I don't respect it at all . Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted February 12, 2015 Share Posted February 12, 2015 AFAIK command chamfer can extend the lines if not intersect. It has many options maybe OP can try to explore more? Quote Link to comment Share on other sites More sharing options...
Lee Chu Chu Posted February 12, 2015 Author Share Posted February 12, 2015 Afaik is not a valid command????? Quote Link to comment Share on other sites More sharing options...
pBe Posted February 12, 2015 Share Posted February 12, 2015 AFAIK command ..... Afaik is not a valid command????? Now that's good one right there, What hanhphuc meant was "As Far As I Know" . If you want to chamfer, i suggest you play around with the "chamfer" command using a macro Quote Link to comment Share on other sites More sharing options...
Lee Chu Chu Posted February 12, 2015 Author Share Posted February 12, 2015 I know I can use the chamfer command in the commandline and explore options but the lisp I am trying to write is to be able to chamfer two intersecting lines while they are being drawn and while the lisp is active. PS: I wasn't even joking about not knowing that AFAIK is an acronym. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 12, 2015 Share Posted February 12, 2015 (edited) Have a think about create a line (setq obj1 (entlast)) and a bit more chamfer obj1 obj2 Edited February 12, 2015 by BIGAL Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted February 12, 2015 Share Posted February 12, 2015 Now that's good one right there, What hanhphuc meant was "As Far As I Know" . Thanks pBE for clarification I know I can use the chamfer command in the commandline and explore options but the lisp I am trying to write is to be able to chamfer two intersecting lines while they are being drawn and while the lisp is active. not sure you draw 2 lines separately or continuously? or you can draw a polyline first then chamfer with polyline option, all vertex will be chamfered $0.02 Quote Link to comment Share on other sites More sharing options...
Lee Chu Chu Posted February 12, 2015 Author Share Posted February 12, 2015 Both. It needs to find the intersection of two lines but the lines need to be the same linetype Quote Link to comment Share on other sites More sharing options...
Lee Chu Chu Posted February 13, 2015 Author Share Posted February 13, 2015 (defun c:test () (setq PT1 (getpoint)) (setq PT2 (getpoint PT1)) (command "line" PT1 PT2) (command) (setq obj1 (entget (entlast))) (setq typeinfo1 (substr (cdr (assoc 0 obj1))1)) (setq layerinfo1 (substr (cdr (assoc 8 obj1))1)) (setq ent (car PT2)) (if (not ent) (princ "yay!") ) (command "line" pause pause) (command) (setq obj2 (entget (entlast))) (setq typeinfo2 (substr (cdr (assoc 0 obj2))1)) (setq layerinfo2 (substr (cdr (assoc 8 obj2))1)) (if (and (= typeinfo1 typeinfo2) (= layerinfo1 layerinfo2)) (princ "\nit works\n") ) (princ) ) This is what I have at the moment for if I draw a line and it finds an existing line with the same layer I chamfer those two lines. Only problem is that I am struggling to program the part where it checks to see if that on the second point of my first drawn line, there is an existing line where it intersects with Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted February 13, 2015 Share Posted February 13, 2015 This is what I have at the moment for if I draw a line and it finds an existing line with the same layer I chamfer those two lines. Only problem is that I am struggling to program the part where it checks to see if that on the second point of my first drawn line, there is an existing line where it intersects with it's good start you attempt coding yourself perhap like this? (defun c:test (/ PT1 PT2 PT3 PT4 en ss1 ss2) ;;;hanhphuc 13.02.2015 ;;;drawline with chamfer (mapcar 'setvar '(chamfera chamferb) '(5.0 5.0)) ;[color="red"] <--default chamfer value you can change here[/color] (prompt "\nDraw lines.. ") (if (and (setq PT1 (getpoint "\n1st line..")) (setq PT2 (getpoint PT1)) (not(grdraw PT1 PT2 7 0)) (setq PT3 (getpoint "\n2nd line")) (setq PT4 (getpoint PT3)) ) ;_ end of and (progn (redraw) (setq en (mapcar ''((x) (entmakex (vl-list* '(0 . "LINE") (mapcar 'cons '(10 11) (eval (cons 'list x)))))) '((PT1 PT2) (PT3 PT4)) ) ;_ end of mapcar ) ;_ end of setq (foreach x '(ss1 ss2) (set x (ssadd))) (mapcar ''((a b) (ssadd a b)) en (list ss1 ss2)) (vl-cmdf "_.chamfer" ss1 ss2) ) ;_ end of progn ) ;_ end of if (princ) ) ;_ end of defun Quote Link to comment Share on other sites More sharing options...
Lee Chu Chu Posted February 15, 2015 Author Share Posted February 15, 2015 What does this program actually do? Because I already have a program that is a lot simpler than that to draw two lines and then chamfer them? Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted February 15, 2015 Share Posted February 15, 2015 (edited) What does this program actually do? Because I already have a program that is a lot simpler than that to draw two lines and then chamfer them? Code was referred to post#7 It simply uses command chamfer to draw, not complicated. If you do have code why not post earlier ? or perhaps vla-intersectWith method is what you are looking for? Cheers Edited February 16, 2015 by hanhphuc typo intersectwith & post#7 Quote Link to comment Share on other sites More sharing options...
hanhphuc Posted February 15, 2015 Share Posted February 15, 2015 Oh.. if you mean chamfer at 90, If you attempt to code then try draft and post the step if you do manually ,(ie: pseudo code) Perhaps this may help others to attempt if you get stuck 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.