krishnakumaryadav Posted April 16, 2010 Share Posted April 16, 2010 Sir, Pls. write a program to make a line . thanks kky Quote Link to comment Share on other sites More sharing options...
krishnakumaryadav Posted April 16, 2010 Author Share Posted April 16, 2010 I want to know about lisp program that how can make a line. thanks kky Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 16, 2010 Share Posted April 16, 2010 The simplest way: (defun c:l1() (command "._line" '(0 0 0) '(100 200 300) "") ) The better way: (defun c:l2() (entmake (list (cons 0 "LINE") (list 10 0 0 0) (list 11 100 200 300))) ) Quote Link to comment Share on other sites More sharing options...
krishnakumaryadav Posted April 16, 2010 Author Share Posted April 16, 2010 You are not understand my Question, I need only program to make a line at any required Angle. thanks kky ****** this post was moved here from an other thread ***** Quote Link to comment Share on other sites More sharing options...
krishnakumaryadav Posted April 16, 2010 Author Share Posted April 16, 2010 make a line which length is 5 metre & Angle 30 Digree,pls write a lisp program. thanks kky ****** this post was moved here from an other thread ***** Quote Link to comment Share on other sites More sharing options...
krishnakumaryadav Posted April 16, 2010 Author Share Posted April 16, 2010 To know program about making a line, I have write four Question, But I am not find that program, pls see this ouestion & help me. thanks kky ****** this post was moved here from an other thread ***** Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Share Posted April 16, 2010 Bumping the thread after 3 mins! Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 16, 2010 Share Posted April 16, 2010 Krishnakumaryadav Please use ONLY this thread to post your questions about making lines with Lisp. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 16, 2010 Share Posted April 16, 2010 Assuming that you work in millimeters this should work: (defun c:l5( / p d) (setq p (getpoint "Specify the start point") d 5000) (entmake (list '(0 . "LINE") (cons 10 p) (cons 11 (polar p (/ PI 6.0) d)))) ) Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 16, 2010 Share Posted April 16, 2010 Perhaps if you included ALL the necessary details in your question we wouldn't have any misunderstandings about what you are looking for. And please bear in mind that we are all volunteering our time and advice. No one gets paid to sit here full-time and respond immediately to questions whether they are yours, mine or somebody else. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Share Posted April 16, 2010 I agree with ReMark - your posts come across as very demanding. Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 16, 2010 Share Posted April 16, 2010 I think our friend has language problems. For sure he doesn't understand all the labels on the buttons. He posted the message "You don't understand my question" in a two years (or so) old thread, where he never posted before. Let's try to help him this time. Also I must agree that he could ask in a more polite manner... Quote Link to comment Share on other sites More sharing options...
ReMark Posted April 16, 2010 Share Posted April 16, 2010 I admit to being annoyed by the tone of some posts as, like Lee said, they border on being demanding. I agree with fuccaro when he says "let's try to help him". Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Share Posted April 16, 2010 Ok, lets try, we'll see how far we get For a line we need two points; or one point, an angle and a length. We can use the 'command' function, entmake(x) or vla-AddLine to construct the line. (defun Line (p1 p2) (command "_.line" "_non" p1 "_non" p2 "")) (defun Line (p1 p2) (entmakex (list (cons 0 "LINE") (cons 10 p1) (cons 11 p2)))) (defun Line (p1 p2) (vla-AddLine (vla-get-modelspace (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-3D-point p1) (vlax-3D-point p2))) If we want to get the second point with a known angle and length of the line, we can use polar: (Line p1 (polar p1 <angle> <length>)) Quote Link to comment Share on other sites More sharing options...
fuccaro Posted April 16, 2010 Share Posted April 16, 2010 I would use different name, not an AutoCAD native command... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 16, 2010 Share Posted April 16, 2010 I would use different name, not an AutoCAD native command... It shouldn't matter with a subfunction, but probably was a bad choice as he's learning. Quote Link to comment Share on other sites More sharing options...
CAB Posted April 17, 2010 Share Posted April 17, 2010 Doesn't matter to me but I have had similar warnings over the years so I use makeLine. I now avoid system variable names too to prevent confusion for the new programmers. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 17, 2010 Share Posted April 17, 2010 Fair point guys. 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.