Jump to content

Label in the center of each line with the text


Designer68

Recommended Posts

Hello

 

 

Is there a way (lisp) to label lines. I want to draw multiple lines (buildings) and i need a label in the center of each line with the text Left or Right.

Based on the location of the previous line.

 

if possible starting clockwise and counter clockwise as well.

 

 

Link to comment
Share on other sites

This is the example. Start point and toen above ech line if i went left or right. 

The most drawings i have to make are counterclockwise.

 

 

20211213_101035.jpg

Link to comment
Share on other sites

Made this for someone a couple of months ago. They would import a satellite photo and they wanted to pick the corners of the house.

 

;;----------------------------------------------------------------------------;;
;; L Shape House
(defun C:LHouse (/ p1 p2 p3 p4 p5 p6)
  (setq p1 (getpoint "\nPick Point 1")
        p2 (getpoint "\nPick Point 2")
        p3 (getpoint "\nPick Point 3")
        p4 (getpoint "\nPick Point 4")
        p5 (getpoint "\nPick Point 5")
  )
  (setq p6 (list (car p5) (cadr p1)))
  (setvar 'cmdecho 0)
  (command "_.pline" "_non" p1 "_non" p2 "_non" p3 "_non" p4 "_non" p5 "_non" p6 "_CL")
  (setvar 'cmdecho 1)
  (princ)  
)

 

Don't know about the L or R's

  • Like 1
  • Funny 1
Link to comment
Share on other sites

If you draw a pline of picked points and close as normal, then get vertices/co-ordinates you can determine using say pt1 pt2 pt3 angle, is it L or R then label etc the last leg is like angle pt6 pt1 pt2 you should label leg 1-2 need time to think.

  • Like 2
Link to comment
Share on other sites

9 hours ago, BIGAL said:

If you draw a pline of picked points and close as normal, then get vertices/co-ordinates you can determine using say pt1 pt2 pt3 angle, is it L or R then label etc the last leg is like angle pt6 pt1 pt2 you should label leg 1-2 need time to think.

Bigal, 

 

Pt 1 Pt2 needs no label, because it is from the startpoint. So the label starts between 2 and 3

Link to comment
Share on other sites

  • SLW210 changed the title to Label in the center of each line with the text

There is better examples of this as many points as you want Close is supported but still need a enter to stop, busy today so sorry no code time.

 

(defun c:plpts ( / pt)
(setq pt (getpoint "\nStarting point of Pline : "))
(command-s "_.pline" pt)
(while (getpoint "\nPick next pt Enter to stop") )
)

 

  • Like 1
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...