Jump to content

For making a line in lips support


krishnakumaryadav

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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